Esempio n. 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);
        }
Esempio n. 2
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);
            }