private void Initialize(int listenPort, INetworkListener transportListener, Envelope messageEnvelope) { Port = listenPort; listener = transportListener; Envelope = messageEnvelope; listener.Initialize(Port); }
///// <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(); } }