English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
ocamlnet: EAFNOSUPPORT on Max OSX
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-05 (12:40)
From: Joel Reymont <joelr1@g...>
Subject: ocamlnet: EAFNOSUPPORT on Max OSX

Netplex reports EAFNOSUPPORT when starting up on Mac OSX which means  
"Address family not supported by protocol family".

The issue is that in netplex_controller.ml/start_containers you are  

       let (fd_clnt, fd_srv) =
	Unix.socketpair Unix.PF_UNIX Unix.SOCK_STREAM 0 in
       let (sys_fd_clnt, sys_fd_srv) =
	Unix.socketpair Unix.PF_UNIX Unix.SOCK_STREAM 0 in

i.e. creating Unix Domain sockets.

Later on in rpc_transport.ml/stream_rpc_multiplex_controller you are  

     `Sockaddr(Unix.getsockname fd)

which passes, and

     `Sockaddr(Unix.getpeername fd)

which fails with EAFNOSUPPORT.

A Ruby test, on the other hand, ran without a hitch:

irb(main):001:0> require 'socket'
=> true

irb(main):002:0> x = Socket.pair Socket::PF_UNIX, Socket::SOCK_STREAM, 0
=> [#<Socket:0x7daa4>, #<Socket:0x7dab8>]

irb(main):003:0> x.each { |sock| sock.getpeername }
=> [#<Socket:0x7daa4>, #<Socket:0x7dab8>]

	Thanks, Joel