Class ErlMsg
Provides a distributed carrier for Erlang messages
Inheritance
Implements
Inherited Members
Namespace: NFX.Erlang
Assembly: NFX.Erlang.dll
Syntax
public class ErlMsg : IQueable
Remarks
Instances of this class are created to package header and payload information in received Erlang messages so that the recipient can obtain both parts with a single call to NFX.Erlang.ErlMbox.receiveMsg
The header information that is available is as follows:
- a tag indicating the type of message
- the intended recipient of the message, either as a ErlPid or as a ErlAtom, but never both.
- (sometimes) the sender of the message. Due to some eccentric characteristics of the Erlang distribution protocol, not all messages have information about the sending process. In particular, only messages whose tag is RegSend contain sender information.
Message are sent using the Erlang external format (see separate documentation). When a message is received and delivered to the recipient ErlMbox, the body of the message is still in this external representation until Msg is called, at which point the message is decoded. A copy of the decoded message is stored in the OtpMsg so that subsequent calls to Msg do not require that the message be decoded a second time.
Fields
Cookie
Contains cookie if it is to be sent or was received in the message
Declaration
public readonly ErlAtom Cookie
Field Value
Type | Description |
---|---|
ErlAtom |
Paybuf
The payload of this deserialized message
Declaration
public readonly ErlInputStream Paybuf
Field Value
Type | Description |
---|---|
ErlInputStream |
Reason
Reason associated with some messages
Declaration
public readonly IErlObject Reason
Field Value
Type | Description |
---|---|
IErlObject |
Ref
Returns reference contained in this message
Declaration
public readonly ErlRef Ref
Field Value
Type | Description |
---|---|
ErlRef |
TraceToken
Trace token delivered in the message
Declaration
public readonly ErlTrace TraceToken
Field Value
Type | Description |
---|---|
ErlTrace |
Type
The type of message
Declaration
public readonly ErlMsg.Tag Type
Field Value
Type | Description |
---|---|
ErlMsg.Tag |
Properties
HasSender
Returns true if the message has a non-empty sender
Declaration
public bool HasSender { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Msg
Deserialized Erlang message contained in this instance
Declaration
public IErlObject Msg { get; }
Property Value
Type | Description |
---|---|
IErlObject |
Recipient
Get the recipient for this message, as a Pid or a registered name (Atom)
Declaration
public IErlObject Recipient { get; }
Property Value
Type | Description |
---|---|
IErlObject |
RecipientName
Get the name of the recipient for this message
Declaration
public ErlAtom RecipientName { get; }
Property Value
Type | Description |
---|---|
ErlAtom |
Remarks
Messages are sent to Pids or names. If this message was sent to a name then the name is returned by this method
RecipientPid
Get the Pid of the recipient for this message, if it is a Send message
Declaration
public ErlPid RecipientPid { get; }
Property Value
Type | Description |
---|---|
ErlPid |
Remarks
Messages are sent to Pids or names. If this message was sent to a Pid then the Pid is returned by this method. The recipient Pid is also available for link, unlink and exit messages
Sender
Get the sender for this message, as a Pid or a registered name (Atom)
Declaration
public IErlObject Sender { get; }
Property Value
Type | Description |
---|---|
IErlObject |
SenderName
Declaration
public ErlAtom SenderName { get; }
Property Value
Type | Description |
---|---|
ErlAtom |
SenderPid
Returns pid of the sender (may be empty, i.e. SenderPid.Empty == true)
Declaration
public ErlPid SenderPid { get; }
Property Value
Type | Description |
---|---|
ErlPid |
Methods
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |