I would like to fetch the IP address and port number of an incoming TCP/IP connection. Unfortunately gen_tcp
's accept
and recv
functions only give back a socket, while gen_udp
's recv
function also gives back the address information. Is there a straightforward way to collect address information belonging to a socket in Erlang?
相关问题
- Multiple sockets for clients to connect to
- Drakma and Dexador both fails at USocket call whil
- difference between file descriptor and socket file
- Can we create a Silverlight Socket Server ONLY usi
- Is “new” in Erlang part of the official standard a
相关文章
- Socket编程 TCP方式发送时间有点长
- socket() returns 0 in C client server application
- Passing extra metadata to a RequestHandler using p
- How do I get the external IP of a socket in Python
- Native hooking in Android Client
- Is zeroing out the “sockaddr_in” structure necessa
- How do I modify a record in erlang?
- How many times will TCP retransmit
You need
inet/peername 1
. From the Erlang inet docs: