Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Setting unix socket options.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: tom hawkins <tomahawkins@y...>
Subject: [Caml-list] Setting unix socket options.
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