← Back to team overview

marionnet-dev team mailing list archive

[Branch ~marionnet-drivers/ocamlbricks/trunk] Rev 290: Some changes in the Network module: now servers may be launched without providing the port or the...

 

------------------------------------------------------------
revno: 290
committer: Jean-Vincent Loddo <loddo@xxxxxxxxxxxxxxxxxxxx>
branch nick: ocamlbricks
timestamp: Fri 2012-01-06 19:25:30 +0100
message:
  Some changes in the Network module: now servers may be launched without providing the port or the socketfile (in the unix-domain case). The server constructors obtain automatically a free port or a free temporary filename. Furthermore, in the dgram-unix pseudo-connecting model, filenames are choosed (by servers and clients) in order to better understand what's happening:
  
  $ find  /tmp/.toplevel-*/ | sort
  /tmp/.toplevel-17740.0-sockets-d9ace0/
  /tmp/.toplevel-17740.0-sockets-d9ace0/18106.0<===749be5
  /tmp/.toplevel-17740.0-sockets-d9ace0/18107.1<===749be5===<18106.0
  /tmp/.toplevel-17740.0-sockets-d9ace0/18107.1>===749be5===>18106.0
  /tmp/.toplevel-17740.0-sockets-d9ace0/ctrl
  
  Here the process.thread 17740.0 has created a temporary directory in order to accept connections on the unix-stream socket  "ctrl". A client 18106.0 has obtained a connection and it is served by the process 18107.1 (a child of 17740.0, supposedly an OCaml fork remarking the thread no. 1). Note that 18107.1>===749be5===>18106.0 is just a symbolic link to 18106.0<===749be5. Note also that all created files are automatically removed when involved threads exit.
  
  A similar behaviour may be observed when the client is not made with ocamlbricks. In this case, we may obtain a directory content like the following:
  
  $ find  /tmp/.toplevel-*/ | sort
  /tmp/.toplevel-17740.0-sockets-d9ace0/
  /tmp/.toplevel-17740.0-sockets-d9ace0/foo
  /tmp/.toplevel-17740.0-sockets-d9ace0/18107.1<===foo
  /tmp/.toplevel-17740.0-sockets-d9ace0/18107.1>===foo
  /tmp/.toplevel-17740.0-sockets-d9ace0/ctrl
  
  where the socket "foo" is the (unique) file created by the exogeneus client.
modified:
  STRUCTURES/network.ml
  STRUCTURES/network.mli


--
lp:ocamlbricks
https://code.launchpad.net/~marionnet-drivers/ocamlbricks/trunk

Your team marionnet-dev is subscribed to branch lp:ocamlbricks.
To unsubscribe from this branch go to https://code.launchpad.net/~marionnet-drivers/ocamlbricks/trunk/+edit-subscription