Beispiel #1
0
        private async void btnStartServer_Click(object sender, EventArgs e)
        {
            using (Server = new TelnetServer((IPAddress)cmbIPAddress.SelectedItem, (ushort)numPort.Value))
            {
                Server.ServerStarted       += Server_ServerStarted;
                Server.ServerStopping      += Server_ServerStopping;
                Server.ServerStopped       += Server_ServerStopped;
                Server.ServerShuttingDown  += Server_ServerShuttingDown;
                Server.IncomingMessage     += Server_MessageTransmitting;
                Server.OutgoingMessage     += Server_MessageTransmitting;
                Server.NewConnection       += Server_NewConnection;
                Server.RemoteDisconnected  += Server_RemoteDisconnected;
                Server.RemoteDisconnecting += Server_RemoteDisconnecting;

                await Server.StartAsync();
            }
        }