Age | Commit message (Collapse) | Author |
|
For gen_tcp, gen_udp and gen_sctp controlling_process/2 can return
badarg if erlang:port_connect/2 fails with badarg. This can easily
happen if the new owner is not alive but in some race condition also
when the socket is closed right before port_connect/2 (and after the
previous socket function)
This commit documents this behaviour.
|
|
|
|
* saleyn/uds/PR-612/OTP-13572:
Rewrite inet* for address family 'local'
Rewrite inet_drv for AF_LOCAL
Assign externally open fd to gen_tcp (UDS support)
Conflicts:
erts/preloaded/ebin/prim_inet.beam
lib/kernel/doc/src/gen_tcp.xml
lib/kernel/doc/src/gen_udp.xml
lib/kernel/src/inet6_sctp.erl
lib/kernel/test/inet_SUITE.erl
|
|
|
|
* henrik/update-copyrightyear:
update copyright-year
|
|
Language cleaned up by technical writers from Combitech.
Proofreading and corrections by Björn Gustavsson and
Hans Bolinder.
|
|
|
|
When a AF_LOCAL file descriptor is created externally (e.g. Unix
Domain Socket) and passed to `gen_tcp:listen(0, [{fd, FD}])`, the
implementation incorrectly assigned the address family to be equal
to `inet`, which in the inet_drv driver translated to AF_INET instead
of AF_LOCAL (or AF_UNIX), and an `einval` error code was returned.
This patch fixes this problem such that the file descriptors of the
`local` address family are supported in the inet:fdopen/5,
gen_tcp:connect/3, gen_tcp:listen/2, gen_udp:open/2 calls
|
|
Fix mistakes found by 'xmllint'.
|
|
|
|
The sha of the original change is 52810718b
|
|
Add the {active,N} socket option, where N is an integer in the range
-32768..32767, to allow a caller to specify the number of data messages to
be delivered to the controlling process. Once the socket's delivered
message count either reaches 0 or is explicitly set to 0 with
inet:setopts/2 or by including {active,0} as an option when the socket is
created, the socket transitions to passive ({active, false}) mode and the
socket's controlling process receives a message to inform it of the
transition. TCP sockets receive {tcp_passive,Socket}, UDP sockets receive
{udp_passive,Socket} and SCTP sockets receive {sctp_passive,Socket}.
The socket's delivered message counter defaults to 0, but it can be set
using {active,N} via any gen_tcp, gen_udp, or gen_sctp function that takes
socket options as arguments, or via inet:setopts/2. New N values are added
to the socket's current counter value, and negative numbers can be used to
reduce the counter value. Specifying a number that would cause the socket's
counter value to go above 32767 causes an einval error. If a negative
number is specified such that the counter value would become negative, the
socket's counter value is set to 0 and the socket transitions to passive
mode. If the counter value is already 0 and inet:setopts(Socket,
[{active,0}]) is specified, the counter value remains at 0 but the
appropriate passive mode transition message is generated for the socket.
This commit contains a modified preloaded prim_inet.beam due to changes in
prim_inet.erl.
Add tests for {active,N} mode for TCP, UDP, and SCTP sockets.
Add documentation for {active,N} mode for inet, gen_tcp, gen_udp, and
gen_sctp.
|
|
|
|
|
|
* lukas/kernel/fix-gen_udp_tcp-leak/OTP-10094:
Add testcase for controlling_process(P,self())
Fix port leaking after controlling_process(Port, self())
|
|
|
|
* same as ip option
|
|
|
|
* UDP: ulticast_if, multicast_loop and multicast_ttl,
add_membership and drop_membership
* Inet: bit8, buffer, deliver, high_watermark, linger and
low_watermark
|
|
Add case to handle the situation when someone call
{gen_tcp,gen_udp}:controlling_process(Port, self()). Also improve spec
and doc from gen_udp and gen_sctp for controlling_process/2.
To reproduce the issue, open an UDP port:
4> {ok,Port} = gen_udp:open(9000, [binary]).
{ok,#Port<0.587>}
5> gen_udp:controlling_process(Port, self()).
ok
Simulate error:
6> 1=2.
** exception error: no match of right hand side value 2
Here is the leak:
7> inet:i().
Port Module Recv Sent Owner Local Address Foreign Address State
Type
581 inet_udp 0 0 <0.31.0> *:cslistener *:* BOUND
DGRAM
ok
|
|
|
|
|
|
|