From 2a040cf7c0cc6415b4bb5152b58d8a98a59d6a81 Mon Sep 17 00:00:00 2001
From: Micael Karlberg
Some functions allow for an asynchronous call.
+ This is achieved by setting the
Note that all other users are locked out until the + 'current user' has called the function (recv in this case).
+There is currently no support for Windows.
Support for IPv6 has been implemented but not tested.
@@ -64,6 +78,15 @@Accept a connection on a socket.
@@ -268,6 +291,26 @@Accept a connection on a socket.
+ +This call is used with connection-based socket types
+ (
In the case when there is no connections waiting, the function
+ will return with the
Cancel an asynchronous request.
+ +Call this function in order to cancel a previous
+ asynchronous call to, e.g.
+
Receive a message from a socket.
+There is a special case for the argument
Receive a message from a socket.
+There is a special case for the argument
In the case when there is no data waiting, the function
+ will return with the
Note that if a length (
Receive a message from a socket.
This function reads "messages", which means that regardless of - how much we want to read, it returns when we get a message.
+ how much we want to read, it returns when we get a message + (if the buffer size is to small, the message will be truncated). +The
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 recvfrom call + is needed, possibly with a then adjusted buffer size.
+Receive a message from a socket.
+This function reads "messages", which means that regardless of + how much we want to read, it returns when we get a message + (if the buffer size is to small, the message will be truncated).
The
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 recvfrom call is needed, possibly with a then adjusted buffer size.
+ +In the case when there is no data waiting, the function
+ will return with the
Receive a message from a socket.
+This function reads "messages", which means that regardless of + how much we want to read, it returns when we get a message.
+The message will be delivered in the form of a
The
The
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.
+Receive a message from a socket.
@@ -461,8 +604,8 @@The
The
In the case when there is no data waiting, the function
+ will return with the
Send a message on a connected socket.
+Send a message on a connected socket.
+ +In the case when there is no room in the (system-) buffers,
+ the function will return with the
Note that if not all the data was sent, the function will return
+ with the remaining data and the
Send a message on a socket. The destination, if needed
+ (socket not connected) is provided in the
Unlike the
Send a message on a socket. The destination, if needed @@ -509,20 +702,42 @@ up to the caller to decide what to do (retry with the remaining data of give up).
+In the case when there is no room in the (system-) buffers,
+ the function will return with the
Send a message on a socket, to the specified destination.
Send a message on a socket, to the specified destination.
+ +In the case when there is no room in the (system-) buffers,
+ the function will return with the
The socket interface (module) is basically an "thin" layer on top of the OS socket interface. It is assumed that, unless you have special needs, - gen_[tcp|udp|sctp] should be sufficent.
+ gen_[tcp|udp|sctp] should be sufficent (when they become available).Note that just because we have a documented and described option, it does not mean that the OS supports it. So its recommended that the user reads the platform specific documentation for the option used.
+Some functions allow for an asynchronous call
+ (
Note that all other users are locked out until the
+ 'current user' has called the function (recv in this case). So either
+ immediately call the function or
+