Class ErlAbstractConnection
Maintains a connection between a C# process and a remote Erlang,
C# or C node. The object maintains connection state and allows
data to be sent to and received from the peer
Inheritance
System.Object
ErlAbstractConnection
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: NFX.Erlang.dll
Syntax
public abstract class ErlAbstractConnection : DisposableObject, IDisposable
Constructors
ErlAbstractConnection(ErlLocalNode, ErlRemoteNode, Nullable<ErlAtom>, Boolean)
Intiate and open a connection to a remote node
Declaration
protected ErlAbstractConnection(ErlLocalNode self, ErlRemoteNode other, ErlAtom? cookie = default (ErlAtom? ), bool connect = true)
Parameters
ErlAbstractConnection(ErlLocalNode, IErlTransport)
Accept an incoming connection from a remote node. Used by ErlLocalNode.Accept
to create a connection
based on data received when handshaking with the peer node, when
the remote node is the connection intitiator.
Declaration
protected ErlAbstractConnection(ErlLocalNode home, IErlTransport s)
Parameters
Fields
CHALLENGE_ACK
Declaration
protected const int CHALLENGE_ACK = 97
Field Value
Type |
Description |
System.Int32 |
|
CHALLENGE_REPLY
Declaration
protected const int CHALLENGE_REPLY = 114
Field Value
Type |
Description |
System.Int32 |
|
CHALLENGE_STATUS
Declaration
protected const int CHALLENGE_STATUS = 115
Field Value
Type |
Description |
System.Int32 |
|
DEFAULT_MAX_PAYLOAD_LENGTH
Declaration
protected const int DEFAULT_MAX_PAYLOAD_LENGTH = 134217728
Field Value
Type |
Description |
System.Int32 |
|
Declaration
protected const int HEADER_LEN = 2048
Field Value
Type |
Description |
System.Int32 |
|
m_Connected
Declaration
protected bool m_Connected
Field Value
Type |
Description |
System.Boolean |
|
m_Cookie
Declaration
protected ErlAtom m_Cookie
Field Value
m_CookieOk
Declaration
protected bool m_CookieOk
Field Value
Type |
Description |
System.Boolean |
|
m_Home
Declaration
protected ErlLocalNode m_Home
Field Value
m_Peer
Declaration
protected ErlRemoteNode m_Peer
Field Value
m_ShouldSendCookie
Declaration
protected bool m_ShouldSendCookie
Field Value
Type |
Description |
System.Boolean |
|
m_Transport
Declaration
protected IErlTransport m_Transport
Field Value
PASS_THROUGH
Declaration
protected const byte PASS_THROUGH = 112
Field Value
Type |
Description |
System.Byte |
|
s_Random
Declaration
protected static Random s_Random
Field Value
Type |
Description |
System.Random |
|
Properties
Connected
Determine if the connection is still alive. Note that this method
only reports the status of the connection, and that it is
possible that there are unread messages waiting in the receive
queue
Declaration
public bool Connected { get; }
Property Value
Type |
Description |
System.Boolean |
|
ConnectTimeout
Declaration
public static int ConnectTimeout { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Cookie
Declaration
public ErlAtom Cookie { get; }
Property Value
LocalNode
Declaration
public ErlLocalNode LocalNode { get; }
Property Value
MaxPayloadLength
Max size of the message accepted from the peer.
The connection will be closed if a message is received of size greater than this.
Declaration
public int MaxPayloadLength { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Name
Declaration
public ErlAtom Name { get; }
Property Value
ReceivedBytes
Total number of bytes received from connection
Declaration
public long ReceivedBytes { get; }
Property Value
Type |
Description |
System.Int64 |
|
ReceivedMsgs
Total number of messages received from connection
Declaration
public long ReceivedMsgs { get; }
Property Value
Type |
Description |
System.Int64 |
|
RemoteNode
Declaration
public ErlRemoteNode RemoteNode { get; }
Property Value
SendCookie
Cookie to send along with each distribution message
Declaration
protected ErlAtom SendCookie { get; }
Property Value
SentBytes
Total number of bytes sent through connection
Declaration
public long SentBytes { get; }
Property Value
Type |
Description |
System.Int64 |
|
SentMsgs
Total number of messages sent through connection
Declaration
public long SentMsgs { get; }
Property Value
Type |
Description |
System.Int64 |
|
TraceLevel
Set the trace level for this connection. Normally tracing is off by default
Declaration
public ErlTraceLevel TraceLevel { get; }
Property Value
Methods
Close()
Close the connection to the remote node
Declaration
protected virtual void Close()
Deliver(ErlConnectionException)
Deliver communication exceptions to the recipient
Declaration
protected abstract void Deliver(ErlConnectionException e)
Parameters
Deliver(ErlMsg)
Deliver messages to the recipient
Declaration
protected abstract void Deliver(ErlMsg msg)
Parameters
Type |
Name |
Description |
ErlMsg |
msg |
|
Destructor()
Declaration
protected override void Destructor()
Overrides
DoSend(ErlOutputStream, ErlOutputStream)
Declaration
protected void DoSend(ErlOutputStream header, ErlOutputStream payload = null)
Parameters
Declaration
protected string HeaderType(IErlObject h)
Parameters
Returns
Type |
Description |
System.String |
|
ReadSock(Byte[], Int32, Boolean)
Declaration
protected int ReadSock(byte[] b, int sz, bool readingPayload)
Parameters
Type |
Name |
Description |
System.Byte[] |
b |
|
System.Int32 |
sz |
|
System.Boolean |
readingPayload |
|
Returns
Type |
Description |
System.Int32 |
|
SendRPC(ErlPid, String, String, ErlList)
Send an RPC request to the remote Erlang node
Declaration
public void SendRPC(ErlPid from, string mod, string fun, ErlList args)
Parameters
Type |
Name |
Description |
ErlPid |
from |
|
System.String |
mod |
|
System.String |
fun |
|
ErlList |
args |
|
SendRPCcast(ErlPid, String, String, ErlList)
Send an RPC cast request to the remote Erlang node
Declaration
public void SendRPCcast(ErlPid from, string mod, string fun, ErlList args)
Parameters
Type |
Name |
Description |
ErlPid |
from |
|
System.String |
mod |
|
System.String |
fun |
|
ErlList |
args |
|
Implements
System.IDisposable
Extension Methods