Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* ocamlnet changes needed for Mac OSX
@ 2007-05-05 23:53 Joel Reymont
  0 siblings, 0 replies; only message in thread
From: Joel Reymont @ 2007-05-05 23:53 UTC (permalink / raw)
  To: Gerd Stolpmann; +Cc: OCaml List

Gerd,

I would like to suggest two changes that would enable ocamlnet to  
work on Mac OSX:

1) src/rpc/rpc_transport.ml

let stream_rpc_multiplex_controller ?(close_inactive_descr=true) fd  
esys =
   let sockname = try
     `Sockaddr(Unix.getsockname fd)
   with Unix.Unix_error _ ->
     `Implied in
   let peername = try
     `Sockaddr(Unix.getpeername fd)
   with Unix.Unix_error _ ->
     `Implied in
...

I see `Implied used in other places so this looks sensible to me.

2) src/equeue/uq_engines.ml

class socket_multiplex_controller
          ?(close_inactive_descr = true)
          ?(supports_half_open_connection = false)
          fd esys : datagram_multiplex_controller =

   let fd_style =
     try
       let addr = Unix.getpeername fd in
       (* fd is a connected socket *)
       `Recv_send addr
     with
       | Unix.Unix_error(Unix.ENOTCONN,_,_) ->
	  (* fd is an unconnected socket *)
	  `Recvfrom_sendto
       | Unix.Unix_error(Unix.ENOTSOCK,_,_) ->
	  (* fd is not a socket *)
	  `Read_write
       | _ ->
           `Recvfrom_sendto
   in
...

A default case in the match above to handle the rest of getpeername  
errors.

Please let me know if this is acceptable.

	Thanks, Joel


--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-05 23:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-05 23:53 ocamlnet changes needed for Mac OSX Joel Reymont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox