Source/NFX.Erlang/Connect/ErlMbox.cs
/// <summary>
/// Receive a message complete with sender and recipient information
/// from a remote process. This method blocks at most for the specified
/// time, until a valid message is received or an exception is raised
/// </summary>
/// <param name="timeout">Time in milliseconds</param>
/// <returns>Erlang distributed message or null on timeout</returns>
Receive a message complete with sender and recipient information
from a remote process. This method blocks at most for the specified
time, until a valid message is received or an exception is raised
Receive a message complete with sender and recipient information from a remote process . This method blocks at most for the specified time until a valid message is received or an exception is raised
private ErlMsg receiveMsg(int timeout)
    {
      var msg = Dequeue(timeout);
      if (msg == null)
        return null;
      if (msg is ErlMsg)
      {
        var m = (ErlMsg)msg;
        switch (m.Type)
        {
          case ErlMsg.Tag.Exit:
          case ErlMsg.Tag.Exit2:
            var o = m.Msg;
            throw new ErlExit(m.SenderPid, o);
        }
        return m;
      }
      else if (msg is ErlExit)
        throw (ErlExit)msg;
      else if (msg is ErlAuthException)
        throw (ErlAuthException)msg;
      else if (msg is ErlConnectionException)
        throw (ErlConnectionException)msg;
      else if (msg is ErlException)
        throw (ErlException)msg;
      else
        throw new ErlException(StringConsts.ERL_INVALID_VALUE_ERROR.Args(msg.ToString()));
    }
private ErlMsg receiveMsg ( int timeout ) { var msg = Dequeue ( timeout ) ; if ( msg == null ) return null ; if ( msg is ErlMsg ) { var m = ( ErlMsg ) msg ; switch ( m . Type ) { case ErlMsg . Tag . Exit : case ErlMsg . Tag . Exit2 : var o = m . Msg ; throw new ErlExit ( m . SenderPid , o ) ; } return m ; } else if ( msg is ErlExit ) throw ( ErlExit ) msg ; else if ( msg is ErlAuthException ) throw ( ErlAuthException ) msg ; else if ( msg is ErlConnectionException ) throw ( ErlConnectionException ) msg ; else if ( msg is ErlException ) throw ( ErlException ) msg ; else throw new ErlException ( StringConsts . ERL_INVALID_VALUE_ERROR . Args ( msg . ToString ( ) ) ) ; }
Receive a message complete with sender and recipient information
from a remote process.
Receive a message complete with sender and recipient information from a remote process .
Erlang distributed message or null on timeout
Erlang distributed message or null on timeout
timeout
int
Time in milliseconds
Time in milliseconds