Version française
Home     About     Download     Resources     Contact us    
Browse thread
ocamlnet changes needed for Mac OSX
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Joel Reymont <joelr1@g...>
Subject: ocamlnet changes needed for Mac OSX
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/