Example #1
0
 public static void CallConnectionRejected(this PeerConnectorHooks hooks, NetworkAddress remote)
 {
     hooks.OnConnectionRejected?.Invoke(new ConnectionRejected
     {
         Remote = remote
     });
 }
Example #2
0
        public PeerConnectorContext(PeerConnectorDependencies dependencies, PeerConnectorHooks hooks, PeerConnectorConfiguration configuration)
        {
            this.dependencies  = dependencies;
            this.hooks         = hooks;
            this.configuration = configuration;

            queue = new LeakQueue <PeerConnectorContext>(this);
        }
Example #3
0
 public static void CallConnectionEstablished(this PeerConnectorHooks hooks, NetworkConnection connection)
 {
     hooks.OnConnectionEstablished?.Invoke(new ConnectionEstablished
     {
         Remote     = connection.Remote,
         Connection = connection
     });
 }
Example #4
0
 public PeerConnector(PeerConnectorDependencies dependencies, PeerConnectorHooks hooks, PeerConnectorConfiguration configuration)
 {
     context = new PeerConnectorContext(dependencies, hooks, configuration);
 }
Example #5
0
 public PeerConnector Build(PeerConnectorHooks hooks)
 {
     return(new PeerConnector(dependencies, hooks, configuration));
 }