Inheritance: IDisposable
Exemplo n.º 1
0
 internal TelnetClient (TelnetServer server, TcpClient client) {
     Server = server;
     client.Client.NoDelay = true;
     client.Client.Blocking = false;
     Data = new SocketDataAdapter(client.Client, true);
     Data.ThrowOnDisconnect = false;
     Data.ThrowOnFullSendBuffer = false;
     Encoding encoding = Encoding.ASCII;
     Input = new AsyncTextReader(Data, encoding);
     Output = new AsyncTextWriter(Data, encoding);
     Output.AutoFlush = true;
     _SendFuture = server._Scheduler.Start(SendMessagesTask(), TaskExecutionPolicy.RunWhileFutureLives);
 }
Exemplo n.º 2
0
        static void Main (string[] args) {
            Scheduler = new TaskScheduler();

            World.Create();
            Event.Broadcast(new { Type = EventType.WorldConstructed });

            Server = new TelnetServer(Scheduler, System.Net.IPAddress.Any, 23);
            Scheduler.Start(HandleNewClients(), TaskExecutionPolicy.RunAsBackgroundTask);

            while (true) {
                Scheduler.Step();
                Scheduler.WaitForWorkItems();
            }
        }
Exemplo n.º 3
0
        internal TelnetClient(TelnetServer server, TcpClient client)
        {
            Server = server;
            client.Client.NoDelay  = true;
            client.Client.Blocking = false;
            Data = new SocketDataAdapter(client.Client, true);
            Data.ThrowOnDisconnect     = false;
            Data.ThrowOnFullSendBuffer = false;
            Encoding encoding = Encoding.ASCII;

            Input            = new AsyncTextReader(Data, encoding);
            Output           = new AsyncTextWriter(Data, encoding);
            Output.AutoFlush = true;
            _SendFuture      = server._Scheduler.Start(SendMessagesTask(), TaskExecutionPolicy.RunWhileFutureLives);
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Scheduler = new TaskScheduler();

            World.Create();
            Event.Broadcast(new { Type = EventType.WorldConstructed });

            Server = new TelnetServer(Scheduler, System.Net.IPAddress.Any, 23);
            Scheduler.Start(HandleNewClients(), TaskExecutionPolicy.RunAsBackgroundTask);

            while (true)
            {
                Scheduler.Step();
                Scheduler.WaitForWorkItems();
            }
        }