Age | Commit message (Collapse) | Author |
|
Changed tag type tpo opaque. Also added connect (monitor and
process) cleanup.
OTP-15731
|
|
Had forgot about the connect function. But it can now also
handle the Timeout = nowait, maybe resulting in a select.
Required some nif work also...
OTP-15731
|
|
OTP-15731
|
|
The return value for an async call (Timeout = nowait) will now
(normally) result in a {select, SelectInfo} instead (if a select
was performed).
OTP-15731
|
|
If another process closes the socket, the caller will
receive an abort message instead (of the select message).
OTP-15731
|
|
Document the new way to make asynchronous calls to some
of the functions: accept, all recv and all send.
OTP-15731
|
|
Add the (public) cancel function and the first of
the cancel test cases (recvfrom(nowait)).
|
|
Added test case api_a_sendto_and_recvfrom_udp4.
Also, fixed duplicate spec.
|
|
Update function accept and its spec(s) to handle
the Timeout value of nowait.
|
|
Update function sendmsg and its spec(s) to handle
the Timeout value of nowait.
|
|
Update function sendto and its spec(s) to handle
the Timeout value of nowait.
|
|
Add proper type(s) for the select info. Also add
a utility macro to build the term.
|
|
Update function send and its spec(s) to handle
the Timeout value of nowait.
|
|
Update function recvmsg and its spec(s) to handle
the Timeout value of nowait.
|
|
Update function recvfrom and its spec(s) to handle
the Timeout value of nowait.
Also replaced timestamp method with erlang:monotonic_time(milli_seconds).
|
|
Update function recv and its spec(s) to handle
the Timeout value of nowait.
|
|
Fixed the spec's for function open/3,4.
Also, corrected the test for retreiving resulting
protocol when performing open with proto = 0 (default)
and domain is not local. Local may not be defined
on all platforms.
OTP-15822
|
|
The socket:supports/0,1 now also displays local (Unix Domain Socket).
OTP-15822
|
|
Add a (plain) send and recv small ping-pong test case for
Unix Domain (stream) socket.
Also fixed minor bug in setopt for level 'otp' and option
rcvbuf. Could not be changed if unix domain (stream) socket (local).
OTP-15822
|
|
Corrected various issues and added missing stuff.
Default protocol is now indicated with the atom 'default'
instead of the atom 'null'. Also let the underlying OS
decide what protocol is actually the default protocol.
OTP-15822
|
|
|
|
Forgot about using 'otp_build update_preloaded --no-commit'
when updating the preloaded and compiled with plain erlc...
Caused problems for dyalizer...
OTP-15658
|
|
Make use of the new select functions; enif_select_[read|write],
for read and write select. These functions allows us to construct
the select message ourseves:
{'$socket', Socket, select, Ref}
This is in preparations for when we introduce the 'nowait'
(or something similar) value for the timeout argument (in accept,
read and write funcions).
It also solves (we hope) the term leakage problems (it was difficult
to free the environment when there was only one/socket).
OTP-15496
|
|
The messages sent from the nif code to an erlang process
has been changed to:
{'$socket', Socket :: socket(), Tag :: atom(), Info :: term()}
This is in preparation for (using) the new enif select API.
OTP-15496
|
|
Better handling of socket close. The 'closeRef' needed
its own environment to make if work in both cases (both
called and scheduled).
Also Introduced the enif select wrapper functions (read,
write, stop and cancel). Also add error handling at every
time one of these functions are called.
OTP-14831
|
|
Another broken anchor fixed. The type 'ipv6_pktinfo' was
not exported nor was it part of the doc.
OTP-14831
|
|
Fixed broken links to types and functions.
OTP-14831
|
|
Corrected linking references (links) to functions.
Also added links from getopt/setopt functions to
the users guide.
Also added some comments to the socket module regarding
open with (ready made) descriptor (which is not yet
supported).
OTP-14831
|
|
|
|
|
|
bmk/20190204/socket_as_nif/OTP-14831
|
|
The nif callback functions (nif_open) now instead cause an
'nosup' exception if called (instead of badarg).
The basic type uint16_t, uint32_t and int32_t (C99) replaced
"own" (that is, defined by "us") types Uint16, Uint32 and
Sint32.
The point of this is that our Windows build system seems to
be a bit lacking when it comes to types...
Removed "some stuff" that was if-defed. Different solution
when win32 support for sockets has been improved.
Make sure the socket_*.c util modules are not included
in the building for windows.
OTP-15526
|
|
Its now possible to set a rcvbuf (otp) option value
of {N :: pos_integer(), BufSz :: pos_integer()}.
This value is used for type stream and protocol tcp,
when calling the function recv with length = 0 (zero).
The second value, BufSz, is the actual size of the receive
buffer used when calling the socket recv function, and
the first value, N, is the max number of possible reads
that will be performed (at most), even if there is more
data to read. This is limit the effect of DoS attacks.
OTP-15497
|
|
Add a way to *get* the file descriptor (fd) of a socket.
Useful mostly for debugging.
OTP-15528
|
|
Previously the "message interface" between the functions in
socket.erl and the nif-code (socket_nif.c) was "ad hoc".
This has now been changed so that we have a unified message
{'$socket', SockRef | undefined, Tag, Info}
This also has the added advantage of preparing the code for
when we start using the new select-fucntions (with which
its possible to specify your own message). This will be used
in order to get around our eterm "leak" (we will use a simple
counter, maintained in the nif, instead of the [Recv|Send|Acc]Ref
we generate in the erlang code today.
OTP-14831
|
|
Added ping-pong test cases for UDP, small and medium, using
the sendto/recvfrom and sendmsg/recvmsg functions.
OTP-14831
|
|
The sendmsg function attempts to send *one message*. But
its possible for the underlying software to fail to send
the *entire* message. So, instead of retrying itself, as
send does, the sendmsg function will now instead return
with {ok, Remaining}, leaving it to the caller to decide
what to do.
OTP-14831
|
|
The send and recv test case triggered a two bugs. One was
that there was no re-selecting when only a portion of the data
was received (which meant that we stopped reading).
Also, the wrong 'current' (writer) was reset when demonitor
current reader after a successful read (which meant that
future readers would never have been monitored).
OTP-14831
|
|
Added preliminary documentation for the function socket:supports/0,1,2,3.
It still does not generate proper doc for supports/3 (the last
arg, Opt, don't get a type).
OTP-14831
|
|
The supports function now also handles testing for SCTP and
IPv6 support. Basic test at the moment, but better then nothing.
OTP-14831
|
|
Added the first three socket (level socket) options to the
supports function(s).
OTP-14831
|
|
Internally in the socket module we accessed domain, type and
protocol for an open socket. But as it turns out, domain (family)
is not actually available as a socket option on all platforms.
FreeBSD in this case. So, since we store these values in the socket
descriptor anyway, we switch to use these values for our internal
use instead.
OTP-14831
|
|
Add support for otp level socket options rcvbuf, rcvctrlbuf and
sndctrlbuf. These options define default sizes for these
buffers.
The 'rcvbuf' is used when receiving messages when calling
the recv, recvfrom and recvmsg functions.
The 'rcvctrlbuf' is used for the control message header info
when calling the recvmsg function.
The 'sndctrlbuf' is used for the control message header info
when calling the sendmsg function.
OTP-14831
|
|
Added proper send timeout handling.
Made use of the enif_select(mode = cancel) feature. Each
time a timeout expires, the "active" send (the surrent write
select) has to be cancelled.
OTP-14831
|
|
Added proper connect and accept timeout handling.
Made use of the enif_select(mode = cancel) feature. Each
time a timeout expires, the previous operation (connect or accept)
has to be cancelled (actually its the select operation that has
to be cancelled). Only partial implementation of cancel for now
(connect and accept). More to follow...
OTP-14831
|
|
|
|
Some cleanup and also added a guard to sendmsg to ensure
that only ctrl (cmsg hdr) with actual content will be
"sent down".
OTP-14831
|
|
Updated the (send) cmsghdr type and the handling of it
(in the nif code). Still not tested!
Removed the is_loaded nif function.
Tried to get fix the doc build problem (socket.erl *i think*),
which causes socket.html generation to fail with:
"cannot find module exporting type"
To solve this I tried to run dialyzer on preloaded, and ran into
problems with enc_setopt_value. Update various specs and types
to "solve" this (which did not work).
Updated the nif-stub functions to make dialyzer happy.
|
|
Added support for (recvmsg) control message ipv6_pktinfo, for
level = ipv6 and type = pktinfo. This is enabled by setting the
socket option: recvpktinfo for level ipv6.
Not yet tested!
OTP-14831
|
|
Add more debug printouts for the new sendmsg. Also added
new (erlang) types with doc.
OTP-14831
|