caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Setting unix socket options.
@ 2003-01-13 22:51 tom hawkins
  2003-01-13 23:12 ` Nicolas George
  0 siblings, 1 reply; 2+ messages in thread
From: tom hawkins @ 2003-01-13 22:51 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-13 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-13 22:51 [Caml-list] Setting unix socket options tom hawkins
2003-01-13 23:12 ` Nicolas George

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).