aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src
AgeCommit message (Collapse)Author
2019-08-01Merge branch 'bmk/erts/esock/20190730/select_info/OTP-15958' into maintMicael Karlberg
2019-07-31Merge branch 'raimo/inherit-listen-options/OTP-15824' into maintRaimo Niskanen
* raimo/inherit-listen-options/OTP-15824: The linger option is not transferred on *BSD
2019-07-30[esock] Updated select-infoMicael Karlberg
2019-07-24[esock] Dialyzer related cleanupMicael Karlberg
Removed unnecessary spec's causing dialyzer warnings.
2019-07-24[esock] Incorrect socket address guard in sendtoMicael Karlberg
Invalid guard tests for function sendto. It handled the, invalid, socket address 'null'. Presumably, this was intended for connected UDP sockets. Though, for a connected (UDP) socket, the send function shall be used.
2019-07-17[esock] Handle wildcard address 'broadcast' when bindingMicael Karlberg
Its now possible to bind a socket to the (limited) broadcast address by specifying 'broadcast' as address: socket:bind(Socket, broadcast) This is *only* valid for family 'inet'. Add testing of sending (broadcasting) to both "limited" broadcast address and "subnet-directed" broadcast address. OTP-15904
2019-07-17[esock] Add test case for socket option bindtodeviceMicael Karlberg
Add test case for the socket option bindtodevice. Also make correction in the nif code. Used the wrong option (broadcast). Also added more info to doc. Note sure if this test case actually works. Set and get "works", but the value returned by get is always "". So either we should extend the test to made sure the bind actually has the expected effect or... Something for a rainy day maybe... OTP-15904
2019-07-17[esock] Add test case for socket option acceptconnMicael Karlberg
Add test case for the socket option acceptconn. Also make minor correction (error when trying to set this option was incorrect). Doc was also incorrect (spelled wrong). OTP-15904
2019-07-16The linger option is not transferred on *BSDRaimo Niskanen
2019-07-08[esock] Make it it work for IPv6Micael Karlberg
The nif code expects the socket address to be "complete", that is all fields must exist. This was not the case for a couple of functions, sendto, sendmsg and connect. What was mssing was a call to 'ensure_sockaddr'. Test: 1) Add a condition function to test if IPv6 is available and works. 2) Needed to adjust a test case (actually a common function used in several test cases) since the socket address data type has two optional fields, which we do not initiate (when sending), but the nif-code does fill in. OTP-15897
2019-07-08Merge branch 'bmk/erts/esock/20190626/finalize_counters/OTP-15818' into maintMicael Karlberg
2019-07-08Merge branch 'bmk/erts/esock/20190624/socket_command/OTP-15817' into maintMicael Karlberg
2019-07-08Merge branch 'bmk/erts/esock/20190614/split_modules/OTP-15765' into maintMicael Karlberg
2019-06-27[esock|doc] Add documentation for the (socket) info functionMicael Karlberg
Add documentation for the (socket) info function, which (among other things) return the socket counters. Also typed the return value (socket_info()). OTP-15818
2019-06-26[esock] Counters for individual socketsMicael Karlberg
We already had the counters. But we did not entirely handle counter wrap, especially in related to 'iow' (Inform On Wrap). There was also no way to get to the counter values, so a socket specific info function was implemented (piggy back on the existing "global" info function). And since, we have it, we also add other info in the returned map (number of readers, writers and acceptors). OTP-15818
2019-06-24[esock] Add debug functionMicael Karlberg
Introduced a debug/1 function and made the command/1 internal. OTP-15817
2019-06-24[esock] Add command (nif) functionMicael Karlberg
Add a command function to the socket API. Currently only used for changing global debug. OTP-15817
2019-06-20[esock] Documentation woesMicael Karlberg
Still trying to make --disable-esock to work properly. Now the primary chore is the doc building. OTP-15765
2019-06-18Merge pull request #2270 from essen/dist-get-stat-real-pend-value/OTP-15905Lukas Larsson
Return real pend value in erlang:dist_get_stat/1
2019-06-17Merge branch 'ingela/raimo/udp-send-TOS/ERIERL-294/OTP-15747' into ↵Ingela Anderton Andin
ingela/merge-294 * ingela/raimo/udp-send-TOS/ERIERL-294/OTP-15747: Introduce udp send ancillary data argument down to inet_drv Fix old warnings
2019-06-17Introduce udp send ancillary data argument down to inet_drvRaimo Niskanen
2019-06-14[esock,kernel] net -> prim_net and add (new) netMicael Karlberg
Renamed the current preloaded net module to prim_net and removed the deprecated functions (call, cast, ...). Introduce a "new" net module (in kernel) as an interface module to the (preloaded) prim_net. This one also contains the deprecated functions (call, cast, ...). OTP-15765
2019-06-11fixup! Return real pend value in erlang:dist_get_stat/1Loïc Hoguin
2019-05-29[esock] Types and cleanupMicael Karlberg
Changed tag type tpo opaque. Also added connect (monitor and process) cleanup. OTP-15731
2019-05-29[esock] Connect can now also take a nowait TimeoutMicael Karlberg
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
2019-05-29[esock|doc] Make select_ref opaqueMicael Karlberg
OTP-15731
2019-05-29[esock] Changed return value for a selected async callMicael Karlberg
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
2019-05-29[esock|doc] Add text about the abort messageMicael Karlberg
If another process closes the socket, the caller will receive an abort message instead (of the select message). OTP-15731
2019-05-29[esock|doc] Document the new asynchronous featureMicael Karlberg
Document the new way to make asynchronous calls to some of the functions: accept, all recv and all send. OTP-15731
2019-05-29[socket] Add cancel and the first recvfrom(nowait) cancel test caseMicael Karlberg
Add the (public) cancel function and the first of the cancel test cases (recvfrom(nowait)).
2019-05-29[socket] First nowait test case (sendto and recvfrom udp4)Micael Karlberg
Added test case api_a_sendto_and_recvfrom_udp4. Also, fixed duplicate spec.
2019-05-29[socket] Update accept to handle Timeout = nowaitMicael Karlberg
Update function accept and its spec(s) to handle the Timeout value of nowait.
2019-05-29[socket] Update sendmsg to handle Timeout = nowaitMicael Karlberg
Update function sendmsg and its spec(s) to handle the Timeout value of nowait.
2019-05-29[socket] Update sendto to handle Timeout = nowaitMicael Karlberg
Update function sendto and its spec(s) to handle the Timeout value of nowait.
2019-05-29[socket] Add type and macro for select infoMicael Karlberg
Add proper type(s) for the select info. Also add a utility macro to build the term.
2019-05-29[socket] Update send to handle Timeout = nowaitMicael Karlberg
Update function send and its spec(s) to handle the Timeout value of nowait.
2019-05-29[socket] Update recvmsg to handle Timeout = nowaitMicael Karlberg
Update function recvmsg and its spec(s) to handle the Timeout value of nowait.
2019-05-29[socket] Update recvfrom to handle Timeout = nowaitMicael Karlberg
Update function recvfrom and its spec(s) to handle the Timeout value of nowait. Also replaced timestamp method with erlang:monotonic_time(milli_seconds).
2019-05-29[socket] Update recv to handle Timeout = nowaitMicael Karlberg
Update function recv and its spec(s) to handle the Timeout value of nowait.
2019-05-29[esock] Fixed check domain local and specsMicael Karlberg
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
2019-05-29[esock] Update the supports functions to also display localMicael Karlberg
The socket:supports/0,1 now also displays local (Unix Domain Socket). OTP-15822
2019-05-29[esock|test] Add plain send/recv small ping-pong test case for localMicael Karlberg
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
2019-05-29[esock] Finalize handling of Unix Domain SocketMicael Karlberg
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
2019-04-30[net] Improvements (ahum) when --disable-esockMicael Karlberg
The net module uses socket, but when the system has been built with --disable-esock, there is no socket...
2019-04-30[socket|net] Final prepMicael Karlberg
The config options --[en|dis]able-esock now works as expected.
2019-04-30[socket] Preloaded (erts) app fileMicael Karlberg
The optional socket module is now not included in the app file if esock is not enabled. OTP-15658
2019-04-30[socket] Preliminary - make socket configurableMicael Karlberg
Preliminary work to make socket configurable (enable and disable). OTP-15658
2019-04-17[socket] Make use of the new select (read|write) functionsMicael Karlberg
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
2019-04-17[socket] Messages from the nif code now has a proper socketMicael Karlberg
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
2019-03-19Add possibility to also get size of data from erlang:dist_ctrl_get_data()Rickard Green