Ejemplo n.º 1
0
        public override void Run()
        {
            try
            {
                Socket clientSocket = null;

                while (true)
                {
                    try
                    {
                        clientSocket = _serverSocket.Accept();
                        var handler = new ConnectionHandler(clientSocket, _settings, _newAsduEvent);
                        handler.Start();
                    }
                    catch (IOException e)
                    {
                        this.Publish <Exception>("error", e);
                    }
                    catch (Exception e)
                    {
                        this.Publish("error", e);
                        break;
                    }
                }
            }
            catch (Exception)
            {
                Abort();
            }
        }
Ejemplo n.º 2
0
        public override void Run()
        {
            try
            {
                while (true)
                {
                    try
                    {
                        var clientSocket = _serverSocket.Accept();
                        if (_connectionCount == _maxConnections)
                        {
                            clientSocket.Close();
                            continue;
                        }

                        var handler = new ConnectionHandler(clientSocket, _settings, _newAsduEvent, _pubSubHub);
                        handler.Start();
                        _connectionCount++;
                    }
                    catch (IOException e)
                    {
                        _pubSubHub.Publish <Exception>(this, "error", e);
                    }
                    catch (Exception e)
                    {
                        _pubSubHub.Publish(this, "error", e);
                        break;
                    }
                }
            }
            catch (Exception)
            {
                Abort();
            }
        }
Ejemplo n.º 3
0
        public override void Run()
        {
            try
            {
                Socket clientSocket = null;

                while(true)
                {
                    try
                    {
                        clientSocket = _serverSocket.Accept();
                        var handler = new ConnectionHandler(clientSocket, _settings);
                        handler.Start();
                    }
                    catch (IOException)
                    {
                    }                   
                }
            }
            catch(Exception)
            {
                Abort();
            }                     
        }