anchor.diff:                  {?ESOCK_TAG, _Socket, select, SendRef}
                     when (Written > 0) -> 
                       <<_:Written/binary, Rest/binary>> = Data,
  -                    send_common(
  +                    send_common_deadline(
                         SockRef, Rest, To, Flags, Deadline, SendName);
  -
                   {?ESOCK_TAG, _Socket, select, SendRef} ->
  -                    send_common(
  +                    send_common_deadline(
                         SockRef, Data, To, Flags, Deadline, SendName);
  -
                   {?ESOCK_TAG, _Socket, abort, {SendRef, Reason}} ->
                       {error, {Reason, byte_size(Data)}}
  -
               after Timeout ->
                       _ = cancel(SockRef, SendName, SendRef),
                       {error, {timeout, byte_size(Data)}}
               end;
  -
  -
  -        select when (Deadline =:= nowait) ->
  -            ?SELECT(SendName, SendRef);
  -
           select ->
  +            %% Wait for continuation
               Timeout = timeout(Deadline),
               receive
                   {?ESOCK_TAG, _Socket, select, SendRef} ->
  -                    send_common(
  +                    send_common_deadline(
                         SockRef, Data, To, Flags, Deadline, SendName);
  -
                   {?ESOCK_TAG, _Socket, abort, {SendRef, Reason}} ->
                       {error, {Reason, byte_size(Data)}}
  -
               after Timeout ->
                       _ = cancel(SockRef, SendName, SendRef),
                       {error, {timeout, byte_size(Data)}}
               end;
  -
  -
  -        {error, exbusy} = Error when Deadline =:= nowait -> Error;
  -
  +        %%
           {error, exbusy = Reason} ->
               %% Internal error:
               %%   we called send, got eagain, and called send again
               %%   - without waiting for select message
               erlang:error(Reason);
  -
  +        Result ->
  +            send_common_result(Data, Result)
  +    end.
  +
  +send_common_result(Data, Result) ->
  +    case Result of
  +        ok ->
  +            ok;
           {error, Reason} ->
               {error, {Reason, byte_size(Data)}}
       end.
  
positive.code: 	    Timeout = timeout(Deadline),
              receive
                  {?ESOCK_TAG, #socket{ref = LSockRef}, select, AccRef} ->
                      do_accept(LSockRef, Deadline);
  
                  {?ESOCK_TAG, _Socket, abort, {AccRef, Reason}} ->
                      {error, Reason}
  
              after Timeout ->
                      cancel(LSockRef, accept, AccRef),
                      {error, timeout}
              end;
  
  
          {error, _} = ERROR ->
              cancel(LSockRef, accept, AccRef), % Just to be on the safe side...
              ERROR
      end.
  
  
  
  %% ===========================================================================
  
negative.code:         badarg = Reason ->
              erlang:error(Reason, [Socket, MsgHdr, Flags, Timeout]);
          Deadline ->
              sendmsg_loop(SockRef, MsgHdr, Flags, Deadline)
      end;
  sendmsg(Socket, MsgHdr, Flags, Timeout) ->
      erlang:error(badarg, [Socket, MsgHdr, Flags, Timeout]).
  
  sendmsg_loop(SockRef, MsgHdr, Flags, Deadline) ->
      SendRef = make_ref(),
      case prim_socket:sendmsg(SockRef, SendRef, MsgHdr, Flags) of
          ok ->
              %% We are done
              ok;
          %%
          {ok, Written} when is_integer(Written) andalso (Written > 0) ->
              %% We should not retry here since the protocol may not
              %% be able to handle a message being split. Leave it to
  