Beispiel #1
0
        /// <summary>
        /// Start current node. This optionally creates a socket listener
        /// and I/O server
        /// </summary>
        protected override void DoStart()
        {
            m_Connections = new ConcurrentDictionary <ErlAtom, ErlConnection>();
            m_Mailboxes   = new Internal.MboxRegistry(this);

            //bool acceptConnections = true, short port = 0, IPAddress addr = null
            if (m_IoServer != null)
            {
                throw new ErlException("Already started!");
            }

            m_GroupLeader = m_Mailboxes.Create(ConstAtoms.User);

            if (m_AcceptConnections)
            {
                var addr = m_AcceptAddressPort.IsNullOrEmpty()
          ? new IPEndPoint(0, 0)
          : m_AcceptAddressPort.ToIPEndPoint();

                m_Acceptor = new Internal.ErlAcceptor(this, addr.Port, addr.Address);
            }

            m_IoServer  = new Internal.ErlIoServer(this);
            m_RpcServer = new Internal.ErlRpcServer(this);
        }
Beispiel #2
0
 /// <summary>
 /// Create a new mailbox (emulates spawning a new Pid)
 /// </summary>
 public ErlMbox CreateMbox()
 {
     return(m_Mailboxes.Create());
 }
Beispiel #3
0
 /// <summary>
 /// Create a new named mailbox (emulates spawning a new Pid)
 /// </summary>
 public ErlMbox CreateMbox(string name = null)
 {
     CheckServiceActiveOrStarting();
     return(name.IsNullOrWhiteSpace() ? m_Mailboxes.Create()
                                : CreateMbox(new ErlAtom(name)));
 }
Beispiel #4
0
 /// <summary>
 /// Create a new mailbox (emulates spawning a new Pid)
 /// </summary>
 public ErlMbox CreateMbox()
 {
     CheckServiceActiveOrStarting();
     return(m_Mailboxes.Create());
 }