15. Ports and Port Drivers
15 Ports and Port Drivers
Examples of how to use ports and port drivers are provided in Interoperability Tutorial
. For information about the BIFs mentioned, see the erlang(3)
manual page in ERTS.
15.1 Ports
Ports provide the basic mechanism for communication with the external world, from Erlang's point of view. They provide a byte-oriented interface to an external program. When a port has been created, Erlang can communicate with it by sending and receiving lists of bytes, including binaries.
The Erlang process creating a port is said to be the port owner, or the connected process of the port. All communication to and from the port must go through the port owner. If the port owner terminates, so does the port (and the external program, if it is written correctly).
The external program resides in another OS process. By default, it reads from