Module openflax.tcp

TCP/IP socket library for OpenFlax.

Description

TCP/IP socket library for OpenFlax.

Function Index

get_iface_ip_addr/1Acquires the IP address of a given interface.
server/4Implements a generic TCP/IP socket server.

Function Details

get_iface_ip_addr/1

get_iface_ip_addr(Interface::string()) -> ip_addr()

Acquires the IP address of a given interface. Thanks to Samuel Rivas for this code.

server/4

server(Fun::fun(), Port::integer(), Opts::[option()], MaxCon::integer()) -> pid() | {error, reason()}

Implements a generic TCP/IP socket server. Opens a socket with the given options on the given port and spawns Fun(Socket) to handle each incoming connection, up to the specified maximum number of connections.