anchor.diff:        SrcPort :: port_number(),
         Reason  :: term().
   
  -recvfrom(Socket) ->
  -    recvfrom(Socket, ?SOCKET_RECV_FLAGS_DEFAULT).
  -
   recvfrom({socket, _, SockRef}, Flags) when is_list(Flags) ->
       EFlags = enc_recv_flags(Flags),
       nif_recvfrom(SockRef, EFlags).
   
  +
  +%% ---------------------------------------------------------------------------
  +%%
   
   %% -spec recvmsg(Socket, [out] MsgHdr, Flags) -> {ok, Data} | {error, Reason} when
   %%       Socket :: socket(),
  
positive.code:             receive
                  {select, SockRef, SendRef, ready_output} when (Written > 0) ->
                      <<_:Written/binary, Rest/binary>> = Data,
                      do_send(SockRef, make_ref(), Rest, EFlags,
                              next_timeout(TS, Timeout));
                  {select, SockRef, SendRef, ready_output} ->
                      do_send(SockRef, make_ref(), Data, EFlags,
                              next_timeout(TS, Timeout))
              after NewTimeout ->
                      nif_cancel(SockRef, send, SendRef),
                      flush_select_msgs(SockRef, SendRef),
                      {error, timeout}
              end;
          {error, eagain} ->
              receive
                  {select, SockRef, SendRef, ready_output} ->
                      do_send(SockRef, SendRef, Data, EFlags,
                              next_timeout(TS, Timeout))
              after Timeout ->
                      nif_cancel(SockRef, send, SendRef),
                      flush_select_msgs(SockRef, SendRef),
                      {error, timeout}
              end;
  
          {error, _} = ERROR ->
  
negative.code:        is_list(Flags) andalso
         (is_integer(Timeout) orelse (Timeout =:= infinity)) ->
      EFlags = enc_recv_flags(Flags),
      do_recv(Socket, undefined, Length, EFlags, <<>>, EFlags).
  
  %% We need to pass the "old recv ref" around because of the special case
  %% with Length = 0. This case makes it neccessary to have a timeout function
  %% clause since we may never wait for anything (no receive select), and so the
  %% the only timeout check will be the function clause.
  do_recv({socket, _, SockRef} = Socket, _OldRef, Length, EFlags, Acc, Timeout)
    when (Timeout =:= infinity) orelse
         (is_integer(Timeout) andalso (Timeout > 0)) ->
      TS      = timestamp(Timeout),
  