[erlang-questions] SysV IPC

Paul Mineiro paul-trapexit@REDACTED
Wed Sep 16 21:07:16 CEST 2009


On Wed, 16 Sep 2009, Max Lapshin wrote:

> I want to follow question: UNIX domain sockets has very interesting
> possibility to pass fd.
> It is very useful when small acceptor is on 80 port, that connects
> with worker on non-privileged ports.
> Accepted TCP socket with client connection is passed via UNIX socket.
>
> Is there any way to accept such socket in Erlang. If no, than what way
> is to implement such functionality?

Well you can get at the file descriptor with a linked-in driver.  The heat
would be to convert that into a gen_tcp instance but I don't see anything
in the public API that would facilitate that.

You can do pretty much anything with a linked-in driver, including
corrupting memory, deadlocking or crashing the emulator, etc; so they are
not to be taken lightly.

For this particular problem, there are other solutions:

http://erlanganswers.com/web/mcedemo/PrivilegedPort.html

-- p


More information about the erlang-questions mailing list