|
@ -6,6 +6,7 @@ |
|
|
, socket2port/1 |
|
|
, socket2port/1 |
|
|
, str2ip/1 |
|
|
, str2ip/1 |
|
|
, ipToStr/1 |
|
|
, ipToStr/1 |
|
|
|
|
|
, getOpts/1 |
|
|
]). |
|
|
]). |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -46,4 +47,8 @@ str2ip(IP) when is_list(IP) -> |
|
|
[A1, A2, A3, A4] = string:tokens(IP, "."), |
|
|
[A1, A2, A3, A4] = string:tokens(IP, "."), |
|
|
{list_to_integer(A1), list_to_integer(A2), list_to_integer(A3), list_to_integer(A4)}; |
|
|
{list_to_integer(A1), list_to_integer(A2), list_to_integer(A3), list_to_integer(A4)}; |
|
|
str2ip(IP) when is_tuple(IP) -> |
|
|
str2ip(IP) when is_tuple(IP) -> |
|
|
IP. |
|
|
|
|
|
|
|
|
IP. |
|
|
|
|
|
|
|
|
|
|
|
getOpts(Socket) -> |
|
|
|
|
|
inet:getopts(Socket, [active, broadcast, buffer, delay_send, dontroute, exit_on_close, header, high_watermark, ipv6_v6only, keepalive, linger, low_watermark, mode, nodelay, packet, packet_size, priority, read_packets, recbuf, reuseaddr, send_timeout, sndbuf]). |
|
|
|
|
|
|