Exemple #1
0
 private void Initialize(int listenPort, INetworkListener transportListener, Envelope messageEnvelope)
 {
     Port     = listenPort;
     listener = transportListener;
     Envelope = messageEnvelope;
     listener.Initialize(Port);
 }
Exemple #2
0
        ///// <summary>
        ///// Event Raised whenever an outgoing message is sent
        ///// </summary>
        //public event EventHandler<MessageEventArgs> MessageSent;


        #endregion Events

        public void StartServer(int serverPort)
        {
            if (IsStopped)
            {
                _stopEvent.Reset();

                IsStopped = false;

                listener.Initialize(serverPort);

                var serverThread = new Thread(new ThreadStart(ServerMain));
                serverThread.Start();
            }
        }