Inheritance: Gwupe.Communication.P2P.RUDP.Connector.API.TcpTransportConnection
 private void ProxyConnectionOnClosed(ProxyTcpConnection connection)
 {
     if (_openConnections.Contains(connection))
     {
         _openConnections.Remove(connection);
     }
     OnConnectionClosed();
 }
Ejemplo n.º 2
0
 protected override TcpTransportConnection ProcessConnect(ITcpOverUdptSocket socket)
 {
     try
     {
         // Attempt to connect end point
         TcpClient client = new TcpClient();
         client.Connect(ProxyEndPoint);
         // Setup the proxying threads
         ProxyTcpConnection proxyTcpConnection = new ProxyTcpConnection(client, socket);
         return(proxyTcpConnection);
     }
     catch (Exception e)
     {
         Logger.Error(
             "Failed to connect to proxy endpoint [" + ProxyEndPoint + "], cannot proxy : " + e.Message, e);
         return(null);
     }
 }
Ejemplo n.º 3
0
 protected override TcpTransportConnection ProcessConnect(ITcpOverUdptSocket socket)
 {
     try
     {
         // Attempt to connect end point
         TcpClient client = new TcpClient();
         client.Connect(ProxyEndPoint);
         // Setup the proxying threads
         ProxyTcpConnection proxyTcpConnection = new ProxyTcpConnection(client, socket);
         return proxyTcpConnection;
     }
     catch (Exception e)
     {
         Logger.Error(
             "Failed to connect to proxy endpoint [" + ProxyEndPoint + "], cannot proxy : " + e.Message, e);
         return null;
     }
 }
        private void ProcessConnection()
        {
            TcpClient client = this._listener.AcceptTcpClient();

            Logger.Debug("Client connected from  " + client.Client.LocalEndPoint);
            try
            {
                ITcpOverUdptSocket socket             = _transportManager.TCPTransport.OpenConnection(Name);
                ProxyTcpConnection proxyTcpConnection = new ProxyTcpConnection(client, socket);
                proxyTcpConnection.CloseConnection += delegate { ProxyConnectionOnClosed(proxyTcpConnection); };
                _openConnections.Add(proxyTcpConnection);
                OnConnectionAccepted();
            }
            catch (Exception e)
            {
                Logger.Error("Failed to connect to named endpoint " + Name + " : " + e.Message);
                client.Close();
            }
        }
Ejemplo n.º 5
0
 private void ProxyConnectionOnClosed(ProxyTcpConnection connection)
 {
     if (_openConnections.Contains(connection))
     {
         _openConnections.Remove(connection);
     }
     OnConnectionClosed();
 }
Ejemplo n.º 6
0
 private void ProcessConnection()
 {
     TcpClient client = this._listener.AcceptTcpClient();
     Logger.Debug("Client connected from  " + client.Client.LocalEndPoint);
     try
     {
         ITcpOverUdptSocket socket = _transportManager.TCPTransport.OpenConnection(Name);
         ProxyTcpConnection proxyTcpConnection = new ProxyTcpConnection(client, socket);
         proxyTcpConnection.CloseConnection += delegate { ProxyConnectionOnClosed(proxyTcpConnection); };
         _openConnections.Add(proxyTcpConnection);
         OnConnectionAccepted();
     }
     catch (Exception e)
     {
         Logger.Error("Failed to connect to named endpoint " + Name + " : " + e.Message);
         client.Close();
     }
 }