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
+
Some functions allow for an asynchronous call.
This is achieved by setting the
+
+ The caller can now make another
call to the recv function and now expect data.
Note that all other users are locked out until the 'current user' has called the function (recv in this case).
+Another message the user must be prepared for (when making asynchronous
+ calls) is the
+
+ This message indicates
+ that the (asynchronous) operation has been aborted.
+ If, for instance, the socket has been
+ closed (by another process),
There is currently no support for Windows.
diff --git a/erts/doc/src/socket_usage.xml b/erts/doc/src/socket_usage.xml index 3d18bd1af7..fcfe9b54ec 100644 --- a/erts/doc/src/socket_usage.xml +++ b/erts/doc/src/socket_usage.xml @@ -56,8 +56,19 @@ when there is actually nothing to read, it will return withThe user must also be prepared to receive an abort message:
+
+
+ If the operation is aborted
+ for whatever reason (e.g. if the socket is closed "by someone else").
+ The
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
--
cgit v1.2.3
From 64c4668a65195283c7dbc24a677f8d3d46ac5513 Mon Sep 17 00:00:00 2001
From: Micael Karlberg
The caller can now make another call to the recv function and now expect data.
Note that all other users are locked out until the 'current user' has called the function (recv in this case).
Another message the user must be prepared for (when making asynchronous
- calls) is the
This message indicates
that the (asynchronous) operation has been aborted.
If, for instance, the socket has been
- closed (by another process),
There is currently no support for Windows.
diff --git a/erts/doc/src/socket_usage.xml b/erts/doc/src/socket_usage.xml index fcfe9b54ec..9d8141b822 100644 --- a/erts/doc/src/socket_usage.xml +++ b/erts/doc/src/socket_usage.xml @@ -54,25 +54,72 @@The caller can then make another call to the recv function and now expect data.
-The user must also be prepared to receive an abort message: +
The user must also be prepared to receive an abort message:
+ +If the operation is aborted
for whatever reason (e.g. if the socket is closed "by someone else").
- The
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
The general form of the 'socket' message is:
+ +Where the format of
The
The caller can now make another call to the recv function and now expect data.
@@ -67,20 +62,15 @@ 'current user' has called the function (recv in this case).Another message the user must be prepared for (when making asynchronous
calls) is the
This message indicates
that the (asynchronous) operation has been aborted.
- If, for instance, the socket has been
- closed (by another process),
There is currently no support for Windows.
@@ -111,6 +101,8 @@A reference that uniquely identifies the (select) operation.
+In the case when there is no connections waiting, the function
will return with the
This function connects the socket to the address @@ -385,6 +385,24 @@
This function connects the socket to the address
+ specied by the
In the case when its not possible to immediately establish a
+ connection, the function will return with the
+
In the case when there is no data waiting, the function
will return with the
In the case when there is no data waiting, the function
will return with the
In the case when there is no data waiting, the function
will return with the
In the case when there is no room in the (system-) buffers,
the function will return with the
In the case when there is no room in the (system-) buffers,
the function will return with the
In the case when there is no room in the (system-) buffers,
the function will return with the
Some functions allow for an asynchronous call
(
The caller can then make another call to the recv function and now expect data.
@@ -79,24 +76,18 @@If the operation is aborted
for whatever reason (e.g. if the socket is closed "by someone else").
The
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
The general form of the 'socket' message is:
-The
The
A tag that describes the (select) operation.
+A reference that uniquely identifies the (select) operation.
+A reference that uniquely identifies the (select) operation.