Ejemplo n.º 1
0
        public void Connect(SocketIn socketIn, SocketOut socketOut)
        {
            var lastConnection = socketIn.Connection;

            _history.Execute(() =>
            {
                if (lastConnection != null)
                {
                    _connections.Remove(lastConnection.Guid);
                }
                var connection = socketIn.Connect(socketOut, Guid.NewGuid());
                _connections.Add(connection.Guid, connection);
            },
                             () =>
            {
                if (lastConnection != null)
                {
                    _connections.Remove(socketIn.Connection.Guid);
                    var connection = socketIn.Connect(lastConnection.Out, lastConnection.Guid);
                    _connections.Add(connection.Guid, connection);
                }
            }, "connect sockets");
        }
Ejemplo n.º 2
0
 public Connection(Guid guid, SocketIn inSocket, SocketOut outSocket)
 {
     Guid = guid;
     In   = inSocket;
     Out  = outSocket;
 }