From 043cb47a1967a63b316c7bd4cb4232f2e9b0f895 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 30 Apr 2019 15:06:15 +0200 Subject: [esock|doc] Add text about the abort message If another process closes the socket, the caller will receive an abort message instead (of the select message). OTP-15731 --- erts/doc/src/socket_usage.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'erts/doc/src/socket_usage.xml') 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 with {ok, SelectInfo}. When data eventually arrives a 'select message' will be sent to the caller: - {'$socket', Sock, select, Info}. The caller can make another + + {'$socket', Sock, select, Info} + + 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: + + {'$socket', Sock, abort, Reason} + + If the operation is aborted + for whatever reason (e.g. if the socket is closed "by someone else"). + The Reason part contains the abort reason (in case the socket + has been closed Reason = {Ref, closed}).

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