diff options
Diffstat (limited to 'erts/preloaded/src/prim_socket.erl')
-rw-r--r-- | erts/preloaded/src/prim_socket.erl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/erts/preloaded/src/prim_socket.erl b/erts/preloaded/src/prim_socket.erl index 68c950331a..8da47bba82 100644 --- a/erts/preloaded/src/prim_socket.erl +++ b/erts/preloaded/src/prim_socket.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2018-2022. All Rights Reserved. +%% Copyright Ericsson AB 2018-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -512,6 +512,10 @@ send(SockRef, Bin, EFlags, SendRef) when is_integer(EFlags) -> {select, Written} -> <<_:Written/binary, RestBin/binary>> = Bin, {select, RestBin, EFlags}; + + completion = C -> + C; + {error, _Reason} = Result -> Result end; @@ -558,11 +562,13 @@ sendto(SockRef, Bin, To, Flags, SendRef) -> sockaddr -> {error, {invalid, {Cause, To}}} end; + ok -> ok; {ok, Written} -> <<_:Written/binary, RestBin/binary>> = Bin, {ok, RestBin}; + select -> Cont = {To, ETo, EFlags}, {select, Cont}; @@ -570,6 +576,10 @@ sendto(SockRef, Bin, To, Flags, SendRef) -> <<_:Written/binary, RestBin/binary>> = Bin, Cont = {To, ETo, EFlags}, {select, RestBin, Cont}; + + completion = C-> + C; + {error, _Reason} = Result -> Result end @@ -621,6 +631,7 @@ sendmsg_result( sendmsg_result( SockRef, RestIOV, Cont, SendRef, true, nif_sendmsg(SockRef, EMsg, EFlags, SendRef, RestIOV)); + select -> if HasWritten -> @@ -631,6 +642,11 @@ sendmsg_result( {select, Written} -> RestIOV = rest_iov(Written, IOV), {select, RestIOV, Cont}; + + %% Either the message was written or not. No half ways... + completion = C -> + C; + {error, Reason} = Error-> if HasWritten -> |