<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/01/047f0a828ed5d8eab79372879e151577"
  from="tom hawkins &lt;tomahawkins@y...&gt;"
  author="tom hawkins"
  date="2003-01-13T22:51:44"
  subject="[Caml-list] Setting unix socket options."
  prev="2003/01/e68da1103fc1d3b3fcbe8b9331addc26"
  next="2003/01/04090fa7e7d7b5c29c72124709785397"
  next-in-thread="2003/01/04090fa7e7d7b5c29c72124709785397"
  prev-thread="2003/01/e68da1103fc1d3b3fcbe8b9331addc26"
  next-thread="2003/01/0dd0b46584a7a0b466d9c2f5820331a4"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Setting unix socket options.">
<msg 
  url="2003/01/047f0a828ed5d8eab79372879e151577"
  from="tom hawkins &lt;tomahawkins@y...&gt;"
  author="tom hawkins"
  date="2003-01-13T22:51:44"
  subject="[Caml-list] Setting unix socket options.">
<msg 
  url="2003/01/04090fa7e7d7b5c29c72124709785397"
  from="Nicolas George &lt;nicolas.george@e...&gt;"
  author="Nicolas George"
  date="2003-01-13T23:12:47"
  subject="Re: [Caml-list] Setting unix socket options.">
</msg>
</msg>
</thread>

<contents>
Hello all,

I just started playing with sockets through Ocaml, but I'm 
having difficultly setting options on a socket.
I can get the options just fine (getsockopt), but
when I try to set an option I get "permission denied".
Here's my test code:

open Unix;;

let s = socket PF_INET SOCK_STREAM 0;;

let f () =
  setsockopt s SO_DEBUG true;;

let main () =
  if not (getsockopt s SO_DEBUG) then begin print_string "DebugOff"; print_newline () end;
  handle_unix_error f ();;

main ();;

Compiles fine.  Running produces this:

DebugOff
./server: "setsockopt" failed: Permission denied

What am I doing wrong?

Thanks,
Tom


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

