Class ErlLocalNode
Inheritance
System.Object
ErlLocalNode
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)
Assembly: NFX.Erlang.dll
Syntax
public class ErlLocalNode : ErlAbstractNode, IApplicationComponent, IDisposable, IService, IConfigurable, ILocalizedTimeProvider, IApplicationFinishNotifiable, INamed
Constructors
ErlLocalNode(String, ErlAtom, Boolean, Boolean)
Create a node with the given name, cookie, and short name indicator
Declaration
public ErlLocalNode(string node, ErlAtom cookie, bool shortName = true, bool acceptConns = true)
Parameters
Type |
Name |
Description |
System.String |
node |
|
ErlAtom |
cookie |
|
System.Boolean |
shortName |
|
System.Boolean |
acceptConns |
|
ErlLocalNode(String, Boolean, Boolean)
Create a node with the given name and the default cookie
Declaration
public ErlLocalNode(string node, bool shortName = true, bool acceptConns = true)
Parameters
Type |
Name |
Description |
System.String |
node |
|
System.Boolean |
shortName |
|
System.Boolean |
acceptConns |
|
Fields
m_OnReadWrite
Delegate invoked on read/write from socket
Declaration
protected ReadWriteEventHandler m_OnReadWrite
Field Value
Properties
AcceptConnections
If true local node will start a listener
Declaration
[Config("$accept")]
public bool AcceptConnections { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
AllNodeConfigs
Declaration
public ConfigSectionNode AllNodeConfigs { get; }
Property Value
Connections
Declaration
public IEnumerator<KeyValuePair<ErlAtom, ErlConnection>> Connections { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<ErlAtom, ErlConnection>> |
|
Creation
Contains node creation bits that facilitate Pid uniqueness
upon node restart
Declaration
public byte Creation { get; }
Property Value
Type |
Description |
System.Byte |
|
GroupLeader
Mailbox for handling all I/O directed from remote nodes
Declaration
public ErlMbox GroupLeader { get; }
Property Value
LogUnhandledMsgs
Record unhandled msgs to log
Declaration
[Config]
public bool LogUnhandledMsgs { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
RemoteNodeConfigs
Declaration
public IEnumerable<ConfigSectionNode> RemoteNodeConfigs { get; }
Property Value
TraceLevel
Set the trace level for this connection. Normally tracing is off by default
Declaration
[Config("$trace")]
public ErlTraceLevel TraceLevel { get; set; }
Property Value
TraceToLog
Declaration
[Config]
public bool TraceToLog { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
Add(ErlConnection)
Add a connection to collection
Declaration
public bool Add(ErlConnection conn)
Parameters
Returns
Type |
Description |
System.Boolean |
Returns false if this connection was already previously added
|
ApplicationFinishAfterCleanup(IApplication)
Declaration
public void ApplicationFinishAfterCleanup(IApplication application)
Parameters
ApplicationFinishBeforeCleanup(IApplication)
Declaration
public void ApplicationFinishBeforeCleanup(IApplication application)
Parameters
CloseMbox(ErlMbox)
Declaration
public void CloseMbox(ErlMbox mbox)
Parameters
Connection(ErlAtom, Nullable<ErlAtom>)
Declaration
public ErlConnection Connection(ErlAtom toNode, ErlAtom? cookie = default (ErlAtom? ))
Parameters
Returns
Connection(String, Nullable<ErlAtom>)
Declaration
public ErlConnection Connection(string node, ErlAtom? cookie = default (ErlAtom? ))
Parameters
Type |
Name |
Description |
System.String |
node |
|
System.Nullable<ErlAtom> |
cookie |
|
Returns
CreateMbox(ErlAtom)
Create a new named mailbox (emulates spawning a new Pid)
Declaration
public ErlMbox CreateMbox(ErlAtom name)
Parameters
Returns
CreateMbox(String)
Create a new named mailbox (emulates spawning a new Pid)
Declaration
public ErlMbox CreateMbox(string name = null)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
CreateRef()
Create an Erlang {@link Ref reference}. Erlang
references are based upon some node specific information; this
method creates a reference using the information in this node.
Each call to this method produces a unique reference
Declaration
public ErlRef CreateRef()
Returns
Disconnect(String)
Declaration
public bool Disconnect(string fromNode)
Parameters
Type |
Name |
Description |
System.String |
fromNode |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Overrides
DoStart()
Start current node. This optionally creates a socket listener
and I/O server
Declaration
protected override void DoStart()
Overrides
DoWaitForCompleteStop()
Declaration
protected override void DoWaitForCompleteStop()
Overrides
FindMbox(ErlAtom)
Determine the mailbox corresponding to a
registered name on this ErlLocalNode
Declaration
public ErlMbox FindMbox(ErlAtom name)
Parameters
Returns
MakeLocalNodeForThisAppOnThisHost()
Makes local node name based on app id and local host name
Declaration
public static string MakeLocalNodeForThisAppOnThisHost()
Returns
Type |
Description |
System.String |
|
OnConnectAttempt(ErlAtom, Direction, Object)
Declaration
protected virtual void OnConnectAttempt(ErlAtom node, Direction dir, object info)
Parameters
OnEpmdFailedConnectAttempt(ErlAtom, Object)
Declaration
protected void OnEpmdFailedConnectAttempt(ErlAtom node, object info)
Parameters
Type |
Name |
Description |
ErlAtom |
node |
|
System.Object |
info |
|
OnIoOutput(ErlAtom, IErlObject)
Declaration
protected virtual void OnIoOutput(ErlAtom encoding, IErlObject output)
Parameters
OnNodeStatusChange(ErlAtom, Boolean, Object)
Declaration
protected virtual void OnNodeStatusChange(ErlAtom node, bool up, object info)
Parameters
Type |
Name |
Description |
ErlAtom |
node |
|
System.Boolean |
up |
|
System.Object |
info |
|
OnReadWrite(ErlAbstractConnection, Direction, Int32, Int64, Int64)
Declaration
protected virtual void OnReadWrite(ErlAbstractConnection conn, Direction dir, int lastBytes, long totalBytes, long totalMsgs)
Parameters
OnTrace(ErlTraceLevel, Direction, Func<String>, String, Int32)
Declaration
protected virtual void OnTrace(ErlTraceLevel type, Direction dir, Func<string> msgFunc, string file = null, int line = 0)
Parameters
Type |
Name |
Description |
ErlTraceLevel |
type |
|
Direction |
dir |
|
System.Func<System.String> |
msgFunc |
|
System.String |
file |
|
System.Int32 |
line |
|
OnTrace(ErlTraceLevel, Direction, String, String, Int32)
Declaration
protected void OnTrace(ErlTraceLevel type, Direction dir, string msg, string file = null, int line = 0)
Parameters
OnTraceCore(ErlTraceLevel, Direction, String, String, Int32)
Declaration
protected virtual void OnTraceCore(ErlTraceLevel type, Direction dir, string msg, string file, int line)
Parameters
OnUnhandledMsg(ErlConnection, ErlMsg, String, Int32)
Declaration
protected virtual void OnUnhandledMsg(ErlConnection conn, ErlMsg msg, string file = null, int line = 0)
Parameters
RemoteNodeConfig(String)
Get configuration settings for a given remote node
Declaration
public ConfigSectionNode RemoteNodeConfig(string remoteNodeName)
Parameters
Type |
Name |
Description |
System.String |
remoteNodeName |
|
Returns
Remove(ErlConnection)
Remove a connection from collection
Declaration
public void Remove(ErlConnection conn)
Parameters
RPC(ErlAtom, ErlAtom, ErlAtom, ErlList, Int32)
Declaration
public IErlObject RPC(ErlAtom node, ErlAtom mod, ErlAtom fun, ErlList args, int timeout)
Parameters
Returns
Send(ErlPid, ErlAtom, ErlAtom, IErlObject)
Send a message to a named mailbox on a given remote node
Declaration
public bool Send(ErlPid from, ErlAtom remoteNode, ErlAtom toName, IErlObject msg)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Send(ErlPid, ErlAtom, IErlObject)
Send a message to a named mailbox on local node
Declaration
public bool Send(ErlPid from, ErlAtom toName, IErlObject msg)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Send(ErlPid, IErlObject)
Send a message to a remote ErlPid, representing
either another ErlMbox or an Erlang process
Declaration
public bool Send(ErlPid to, IErlObject msg)
Parameters
Returns
Type |
Description |
System.Boolean |
true if message was sent successfully
|
WaitAny(ErlMbox[])
Declaration
public int WaitAny(params ErlMbox[] mboxes)
Parameters
Type |
Name |
Description |
ErlMbox[] |
mboxes |
|
Returns
Type |
Description |
System.Int32 |
|
WaitAny(ErlMbox[], Int32)
Wait for arrival of messages in any one of the given mailboxes
Declaration
public int WaitAny(ErlMbox[] mboxes, int msecTimeout = -1)
Parameters
Type |
Name |
Description |
ErlMbox[] |
mboxes |
Mailboxes to wait for messages in
|
System.Int32 |
msecTimeout |
Timeout in milliseconds
|
Returns
Type |
Description |
System.Int32 |
Index of the first non-empty mailbox or -1 on timeout
|
WaitAny(IEnumerable<ErlMbox>, Int32)
Declaration
public int WaitAny(IEnumerable<ErlMbox> mboxes, int msecTimeout = -1)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<ErlMbox> |
mboxes |
|
System.Int32 |
msecTimeout |
|
Returns
Type |
Description |
System.Int32 |
|
WaitAny(Int32, ErlMbox[])
Declaration
public int WaitAny(int msecTimeout, params ErlMbox[] mboxes)
Parameters
Type |
Name |
Description |
System.Int32 |
msecTimeout |
|
ErlMbox[] |
mboxes |
|
Returns
Type |
Description |
System.Int32 |
|
Events
ConnectAttempt
Declaration
public event ConnAttemptEventHandler ConnectAttempt
Event Type
EpmdFailedConnectAttempt
Declaration
public event EpmdFailedConnAttemptEventHandler EpmdFailedConnectAttempt
Event Type
IoOutput
Declaration
public event IoOutputEventHandler IoOutput
Event Type
NodeStatusChange
Declaration
public event NodeStatusChangeEventHandler NodeStatusChange
Event Type
ReadWrite
Declaration
public event ReadWriteEventHandler ReadWrite
Event Type
Trace
Trace callback executed if connection tracing is enabled
Declaration
public event TraceEventHandler Trace
Event Type
UnhandledMsg
Declaration
public event UnhandledMsgEventHandler UnhandledMsg
Event Type
Implements
System.IDisposable
Extension Methods