Exemplo n.º 1
0
 public async Task ListenLoop()
 {
     while (this.isRunning)
     {
         var client = listener.AcceptSocket();
         ConnectionHandler connectionHandler = new ConnectionHandler(client, this.serverRoutingTable);
         connectionHandler.ProcessRequestAsync();
     }
 }
Exemplo n.º 2
0
        public async Task ListenLoop()
        {
            while (_isRuning)
            {
                Socket client = await _listener.AcceptSocketAsync();

                ConnectionHandler connectionHandler = new ConnectionHandler(client, _handlerContext);
                await connectionHandler.ProcessRequestAsync();
            }
        }
Exemplo n.º 3
0
        public async Task ListenLoop()
        {
            while (this.isRunning)
            {
                Socket client = await this.tcpListener.AcceptSocketAsync();

                ConnectionHandler connectionHandler = new ConnectionHandler(client, this.routeHandler, this.resourceHandler);
                await connectionHandler.ProcessRequestAsync();
            }
        }
Exemplo n.º 4
0
        public async Task ListenLoop()
        {
            while (this.IsRunning)
            {
                var client = await this.listener.AcceptSocketAsync();

                var connectionHandler = new ConnectionHandler(client, this.serverRoutingTable);
                var responseTask      = connectionHandler.ProcessRequestAsync();
                responseTask.Wait();
            }
        }
Exemplo n.º 5
0
        public async Task ListenLoop()
        {
            while (this.isRunning)
            {
                Socket client = await this.listener.AcceptSocketAsync();

                ConnectionHandler connectionHandler = new ConnectionHandler(client, this.router);
                Task  responseTask = connectionHandler.ProcessRequestAsync();
                await responseTask;
            }
        }
Exemplo n.º 6
0
        public async Task ListenLoop()
        {
            while (this.isRunning)
            {
                var client = await this.listener.AcceptSocketAsync();

                var connectionHandler = new ConnectionHandler(client, this.routeHandlingContext);

                await connectionHandler.ProcessRequestAsync();
            }
        }
Exemplo n.º 7
0
        public async Task ListenLoop()
        {
            while (this.IsRunning)
            {
                var client = await this._listener.AcceptSocketAsync();

                var connectionHandler = new ConnectionHandler(client, this.handler, this.resourceRouter);;

                var responseTask = connectionHandler.ProcessRequestAsync();
                responseTask.Wait();
            }
        }
Exemplo n.º 8
0
        public async Task ListenLoop()
        {
            while (this.isRunning)
            {
                Socket client = await this.listener.AcceptSocketAsync();

                ConnectionHandler connectionHandler = new ConnectionHandler(client, this.serverRoutingTable);
                //Task connection = connectionHandler.ProcessRequestAsync();
                //connection.Wait();
                await connectionHandler.ProcessRequestAsync();
            }
        }
Exemplo n.º 9
0
        public async Task ListenLoop()
        {
            while (this.isRunning)
            {
                var client = await this.listener.AcceptSocketAsync();

                var connectionHandler = new ConnectionHandler(client, this.handler);
                var responseTask      = connectionHandler.ProcessRequestAsync();
                responseTask.Wait();

                //Endless Cycle
            }
        }
Exemplo n.º 10
0
        public async Task ListenLoop()
        {
            Console.WriteLine("Listen loop started!");
            while (this.IsRunning)
            {
                var client = await this.listener.AcceptSocketAsync();

                var connectionHandler = new ConnectionHandler(client, this.serverRoutingTable);
                var responseTask      = connectionHandler.ProcessRequestAsync();
                responseTask.Wait();
                Console.WriteLine("New request handled!");
            }
        }
Exemplo n.º 11
0
        public async Task ListenLoop()
        {
            while (this.isRunning)
            {
                Console.WriteLine("Waiting for client...");

                Socket client = await this.listener.AcceptSocketAsync();

                var connectionHandler = new ConnectionHandler(client, this.serverRoutingTable);

                Task responseTask = connectionHandler.ProcessRequestAsync();
                responseTask.Wait();
            }
        }
Exemplo n.º 12
0
        public async Task ListenLoop()
        {
            while (this.isRunning)
            {
                Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

                var client = await this.listener.AcceptSocketAsync();

                var connectionHandler = new ConnectionHandler(client, this.serverRoutingTable);

                var responseTask = connectionHandler.ProcessRequestAsync();

                responseTask.Wait();
            }
        }
Exemplo n.º 13
0
        public async Task ListenLoop()
        {
            while (this.isRunning)
            {
                Socket client = await this.listener.AcceptSocketAsync();

                StringBuilder result = new StringBuilder();
                result.AppendLine(new string('=', 60));
                result.AppendLine($"Client Connected on {DateTime.Now.ToString(DateTimeFormat)}");
                result.AppendLine(new string('=', 60));
                Console.WriteLine(result.ToString());

                ConnectionHandler connectionHandler = new ConnectionHandler(client, this.serverRoutingTable);
                Task responseTask = connectionHandler.ProcessRequestAsync();
                responseTask.Wait();
            }
        }
Exemplo n.º 14
0
        private async Task ListenLoopAsync()
        {
            while (IsRunning)
            {
                if (listener.Pending())
                {
                    Socket client = await listener.Server.AcceptAsync();

                    var    connection    = new ConnectionHandler(client, services, sessions);
                    Task   responseTask  = connection.ProcessRequestAsync();
                    string clientAddress = client.RemoteEndPoint.ToString().Split(':')[0];
                    if (!uniqueConnections.Any(c => c == clientAddress))
                    {
                        Console.WriteLine($"Connection established from address {clientAddress}");
                        uniqueConnections.Add(clientAddress);
                    }
                    responseTask.Wait();
                }
            }
        }
Exemplo n.º 15
0
        private async Task ListenLoopAsync()
        {
            while (IsRunning)
            {
                if (listener.Pending())
                {
                    Socket client = await listener.Server.AcceptAsync();

                    if (!uniqueClients.Any(c => c.Handle == client.Handle))
                    {
                        Console.Write($"{Environment.UserDomainName}/{Environment.UserName}");
                        Console.WriteLine($" connected [Handle: {client.Handle}]");
                        uniqueClients.Add(client);
                    }
                    var  connection   = new ConnectionHandler(client, services);
                    Task responseTask = connection.ProcessRequestAsync();
                    responseTask.Wait();
                }
            }
        }
Exemplo n.º 16
0
 public async Task ListenLoop(Socket client)
 {
     var connectionHandler = new ConnectionHandler(client, this.requestHandler, this.fileHandler);
     await connectionHandler.ProcessRequestAsync();
 }
Exemplo n.º 17
0
 private async Task ListenAsync(Socket client)
 {
     var connectionHandler = new ConnectionHandler(client, this.serverRoutingTable);
     await connectionHandler.ProcessRequestAsync();
 }
Exemplo n.º 18
0
 public async void ListenLoop(Socket client)
 {
     ConnectionHandler connectionHandler = new ConnectionHandler(client, this.handlerContext);
     await connectionHandler.ProcessRequestAsync();
 }
Exemplo n.º 19
0
 public async void Listen(Socket client)
 {
     var connectionHandler = new ConnectionHandler(client, this.handler);
     await connectionHandler.ProcessRequestAsync();
 }
Exemplo n.º 20
0
 public async void Listen(Socket client)
 {
     var connectionHandler = new ConnectionHandler(client, this.serverRoutingTable);
     await connectionHandler.ProcessRequestAsync();
 }
Exemplo n.º 21
0
        public async Task ListenLoopAsync(Socket client)
        {
            var connectionHandler = new ConnectionHandler(client, handler);

            await connectionHandler.ProcessRequestAsync();
        }