File descriptor passing, was Re: Advantages of a large number of threads....

Scott Lystig Fritchie fritchie@REDACTED
Mon Feb 23 10:01:59 CET 2004


Hi there.  I put my code where my mouth was.  I just checked in to the
Jungerl a driver that can pass file descriptors to and from Erlang
nodes running on the same machine.  It has been lightly tested under
Linux & FreeBSD and appears to work.  Let me know if you have problems
with it ... or fix it yourself!  :-)

I discovered that it's possible to create a UNIX domain socket with a
custom driver, then extract its file descriptor, then use
gen_tcp:fdopen/2 to create a socket that has more nifty properties,
like all of the options supported by inet:setopts/2.  ... Well, I
haven't tested that assertion very thoroughly, but it's a quite
promising & lazy approach.  After all, it would be really nice to be
able to use all those nifty features (like SUN RPC or ASN.1 packet
type encoding) by using someone else's code (namely the inets driver)!

-Scott



More information about the erlang-questions mailing list