コード例 #1
0
ファイル: EndpointContext.cs プロジェクト: deveck/doTSS
 public EndpointContext(FrontEndConnection connection, PacketTransmitter packetTransmitter)
 {
     _connection = connection;
     connection.Disconnected += HandleConnectionDisconnected;
     _packetTransmitter = packetTransmitter;
     _packetTransmitter.RequestPacketReceived += OnRequestPacketReceived;
 }
コード例 #2
0
ファイル: ClientContext.cs プロジェクト: deveck/doTSS
        public ClientContext(FrontEndConnection connection, PacketTransmitter packetTransmitter)
            : base(connection, packetTransmitter)
        {
            _debugClient = new DebugClient (this);
            _authClient = new AuthenticationClient (this);
            _tpmClient = new TPMClient (this);

            RegisterSubsystem (new TPMClientSubsystem (this));

            _configured = true;
            _configuredEvent.Set ();
        }
コード例 #3
0
ファイル: TPMServerContext.cs プロジェクト: deveck/doTSS
 /// <summary>
 /// A new client connected to a listener
 /// </summary>
 /// <param name="connection">The connection to the client</param>
 private void HandleListenerClientConnected(FrontEndConnection connection)
 {
     _logger.InfoFormat ("Client {0} connected", connection);
     ServerContext ctx;
     lock (_activeContexts)
     {
         ctx = EndpointContext.CreateServerEndpointContext (connection,
             (IConnectionsConfiguration)ConfigurationManager.GetSection("connections"),
             _accessControlList, _tpmContexts);
         _activeContexts.Add(ctx);
     }
     connection.Disconnected += delegate
     {
         lock(_activeContexts)
         {
             _logger.InfoFormat("Client {0} disconnected", connection);
             _activeContexts.Remove(ctx);
         }
     };
 }
コード例 #4
0
 /// <summary>
 /// Checks if the AuthenticationMechanism is compatible with the specified connection instance
 /// </summary>
 /// <param name="connection"></param>
 /// <returns></returns>
 public bool IsCompatibleWith(FrontEndConnection connection)
 {
     return IsCompatibleWith(connection.GetType());
 }
コード例 #5
0
ファイル: ServerContext.cs プロジェクト: deveck/doTSS
        public ServerContext(FrontEndConnection connection, PacketTransmitter packetTransmitter, IConnectionsConfiguration connectionConfig,
            AccessControlList acl, IDictionary<string, TPMContext> tpmContexts)
            : base(connection, packetTransmitter)
        {
            _accessControlList = acl;
            _tpmContexts = tpmContexts;

            RegisterSubsystem (new DebugSubsystem (this, connectionConfig));
            RegisterSubsystem (new AuthenticationSubsystem (this, connectionConfig));
            RegisterSubsystem (new TPMSubsystem (this, connectionConfig));
            _configured = true;
            _configuredEvent.Set ();
        }
コード例 #6
0
ファイル: UnixSocketListener.cs プロジェクト: deveck/doTSS
 private void RaiseClientConnectedEvent(FrontEndConnection connection)
 {
     if(ClientConnected != null)
         ClientConnected(connection);
 }
コード例 #7
0
ファイル: EndpointContext.cs プロジェクト: deveck/doTSS
 /// <summary>
 ///Is called once the client disconnects 
 /// </summary>
 /// <param name="obj">A <see cref="FrontEndConnection"/></param>
 protected void HandleConnectionDisconnected(FrontEndConnection obj)
 {
     foreach(ISubsystem subsystem in _subsystems.Values)
         subsystem.Dispose();
     _subsystems.Clear();
 }
コード例 #8
0
ファイル: EndpointContext.cs プロジェクト: deveck/doTSS
 /// <summary>
 /// Creates a ServerContext for the specified connection
 /// </summary>
 public static ServerContext CreateServerEndpointContext(FrontEndConnection connection, IConnectionsConfiguration connectionConfig,
     AccessControlList acl, IDictionary<string, TPMContext> tpmContexts)
 {
     PacketTransmitter packetTransmitter = new PacketTransmitter(connection);
     ServerContext ctx = new ServerContext(connection, packetTransmitter, connectionConfig, acl, tpmContexts);
     packetTransmitter.StartTransmitting();
     return ctx;
 }
コード例 #9
0
ファイル: EndpointContext.cs プロジェクト: deveck/doTSS
 /// <summary>
 /// Creates a ClientContext for the specified connection
 /// </summary>
 public static ClientContext CreateClientEndpointContext(FrontEndConnection connection)
 {
     PacketTransmitter packetTransmitter = new PacketTransmitter(connection);
     ClientContext ctx = new ClientContext(connection, packetTransmitter);
     packetTransmitter.StartTransmitting();
     return ctx;
 }
コード例 #10
0
ファイル: PacketTransmitter.cs プロジェクト: deveck/doTSS
 private void OnConnectionEstablished(FrontEndConnection connection)
 {
     _receiveThreadWaitEvent.Set();
 }
コード例 #11
0
ファイル: PacketTransmitter.cs プロジェクト: deveck/doTSS
 public PacketTransmitter(FrontEndConnection connection)
 {
     _connection = connection;
     _connection.ConnectionEstablished += OnConnectionEstablished;
 }