diff options
author | Micael Karlberg <[email protected]> | 2018-08-03 12:33:22 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-09-18 14:50:18 +0200 |
commit | d8b1eace1cfe3184497752f345e5f6bc5def9769 (patch) | |
tree | 278c697dbedbcd16f2d9445a8e93f2a028ba5079 /erts/doc/src/socket.xml | |
parent | 90a150771faa3cf01e82919b0c17854de9987783 (diff) | |
download | otp-d8b1eace1cfe3184497752f345e5f6bc5def9769.tar.gz otp-d8b1eace1cfe3184497752f345e5f6bc5def9769.tar.bz2 otp-d8b1eace1cfe3184497752f345e5f6bc5def9769.zip |
[socket-nif] Add preliminary support for sendmsg
Added function sendmsg/2,3,4. Actually worked on the first try.
Something must be wrong...
Still no supported cmsghdr's (only support headers where the
data part is already a binary, which therefor does not require
any processing). So if the cmsghdrs actually work is unclear.
OTP-14831
Diffstat (limited to 'erts/doc/src/socket.xml')
-rw-r--r-- | erts/doc/src/socket.xml | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/erts/doc/src/socket.xml b/erts/doc/src/socket.xml index 2fb922408b..93a3a8172e 100644 --- a/erts/doc/src/socket.xml +++ b/erts/doc/src/socket.xml @@ -403,6 +403,40 @@ </func> <func> + <name name="recvmsg" arity="1"/> + <name name="recvmsg" arity="2" clause_i="1"/> + <name name="recvmsg" arity="2" clause_i="2"/> + <name name="recvmsg" arity="3"/> + <name name="recvmsg" arity="5"/> + <fsummary>Receive a message from a socket.</fsummary> + <desc> + <p>Receive a message from a socket.</p> + <p>This function reads "messages", which means that regardless of + how much we want to read, it returns when we get a message.</p> + <p>The message will be delivered in the form of a <c>msghdr()</c>, + which may contain the source address (if socket not connected), + a list of <c>cmsghdr()</c> (depends on what socket options have + been set and what the protocol and platform supports) and + also a set of flags, providing further info about the read . </p> + + <p>The <c>BufSz</c> argument basically defines the size of the + receive buffer. By setting the value to zero (0), the configured + size (setopt with <c>Level</c> = <c>otp</c>) is used.</p> + + <p>The <c>CtrlSz</c> argument basically defines the size of the + receive buffer for the control messages. + By setting the value to zero (0), the configured size (setopt + with <c>Level</c> = <c>otp</c>) is used.</p> + + <p>It may be impossible to know what (buffer) size is appropriate + "in advance", and in those cases it may be convenient to use the + (recv) 'peek' flag. When this flag is provided, the message is *not* + "consumed" from the underlying buffers, so another recvmsg call + is needed, possibly with a then adjusted buffer size.</p> + </desc> + </func> + + <func> <name name="send" arity="2"/> <name name="send" arity="3" clause_i="1"/> <name name="send" arity="3" clause_i="2"/> @@ -414,6 +448,21 @@ </func> <func> + <name name="sendmsg" arity="2"/> + <name name="sendmsg" arity="3" clause_i="1"/> + <name name="sendmsg" arity="3" clause_i="2"/> + <name name="sendmsg" arity="4"/> + <fsummary>Send a message on a socket.</fsummary> + <desc> + <p>Send a message on a socket. The destination, if needed (socket not + connected) is provided in the <c>MsgHdr</c>, which also + contains the message to send, The <c>MsgHdr</c> may also contain + an list of optional <c>cmsghdr()</c> (depends on what the protocol and + platform supports).</p> + </desc> + </func> + + <func> <name name="sendto" arity="3"/> <name name="sendto" arity="4"/> <name name="sendto" arity="5"/> |