Пример #1
0
 public static void CallHandshakeRejected(this HandshakeNegotiatorHooks hooks, NetworkConnection connection)
 {
     hooks.OnHandshakeRejected?.Invoke(new HandshakeRejected
     {
         Connection = connection
     });
 }
Пример #2
0
 public static void CallHandshakeCompleted(this HandshakeNegotiatorHooks hooks, NetworkConnection connection, Handshake handshake)
 {
     hooks.OnHandshakeCompleted?.Invoke(new HandshakeCompleted
     {
         Hash       = handshake.Hash,
         Handshake  = handshake,
         Connection = connection
     });
 }
Пример #3
0
        public HandshakeNegotiatorPassive(NetworkPool pool, NetworkConnection connection, HandshakeNegotiatorPassiveContext context, HandshakeNegotiatorHooks hooks)
        {
            this.context = context;
            this.hooks   = hooks;

            this.connection  = new HandshakeConnection(pool, connection, hooks);
            this.credentials = HandshakeCryptography.Generate();
            this.keys        = new HandshakeKeyContainer();
        }
Пример #4
0
 public HandshakeNegotiator Build(HandshakeNegotiatorHooks hooks)
 {
     return(new HandshakeNegotiatorInstance(dependencies, hooks));
 }
Пример #5
0
 public HandshakeNegotiatorInstance(HandshakeNegotiatorDependencies dependencies, HandshakeNegotiatorHooks hooks)
 {
     this.dependencies = dependencies;
     this.hooks        = hooks;
 }
Пример #6
0
 public HandshakeConnection(NetworkPool pool, NetworkConnection connection, HandshakeNegotiatorHooks hooks)
 {
     this.pool       = pool;
     this.connection = connection;
     this.hooks      = hooks;
 }