I need an answer to the following question to help understand what approach I should be taking to interface with Erlang. AFAIK Erlang on a SMP UNIX box uses the multi-process approach. In this case it should do same machine IPC.
- Does Erlang use UNIX domain sockets for UNIX ?
-
Does it use named-pipes for windows ?
-
If it does not implement both constructs above — i.e., no named-pipes for windows; it must have to fallback to sockets, on windows.
-
How are the above mentioned principles implemented, do they use message oriented, single-thread per channel, asynchronous constructs or is it something else ?
-
If my line of reasoning above is incorrect, does it use a master-child tree and all other processes communicate — indirectly — through the master ?
— edit 1 —
Link to the erlang binary format documentation.
The universal concensus is that Unix Domain Sockets outperform TCP/IP. I think I will try to extend Erlang to use the better primitives provided. I also strongly suspect that epol and windows IOPC is not used in the TCP/IP event loop — I will post back once I have audited the code.
Another SO post that asserts that Erlang indeed, does not support anything other than TCP and UDP.
There are two Erlang libraries for communication Erlang node -> c_node and c_node -> Erlang_node
The Erlang module for sockets allows Unix Dom Sockets to be opened under UNIX.
R1. It uses TCP/IP (in fact, there isn’t any “standard” support for UNIX domain sockets)
R2. I am pretty sure it is still TCP/IP sockets
R3. see R2
R4. There is a binary exchange format proper to Erlang and it is message based. Exchanges can either be sync (RPC-like) or async.
R5. No master.
As bonus (to help you save time): don’t forget to use a registered name (-sname or -name) in order to use inter-node communications (either RPC or whatever).