public NetworkPoolListener(Dictionary <long, NetworkPoolEntry> items, NetworkPoolQueue queue, NetworkPoolHooks hooks, NetworkPoolConfiguration configuration, NetworkPoolDependencies dependencies) { this.items = items; this.queue = queue; this.hooks = hooks; this.configuration = configuration; this.dependencies = dependencies; }
public static void CallConnectionAttached(this NetworkPoolHooks hooks, NetworkConnection connection) { hooks.OnConnectionAttached?.Invoke(new ConnectionAttached { Connection = connection, Remote = connection.Remote }); }
public static void CallConnectionReceived(this NetworkPoolHooks hooks, NetworkConnection connection, int bytes) { hooks.OnConnectionReceived?.Invoke(new ConnectionReceived { Connection = connection, Remote = connection.Remote, Bytes = bytes }); }
public NetworkPoolInstance(NetworkPoolDependencies dependencies, NetworkPoolConfiguration configuration, NetworkPoolHooks hooks) { this.hooks = hooks; this.dependencies = dependencies; this.configuration = configuration; factory = new SocketFactory(dependencies.Completion); items = new Dictionary <long, NetworkPoolEntry>(); queue = new NetworkPoolQueue(this); }
public NetworkPool Build(NetworkPoolHooks hooks) { return(new NetworkPoolInstance(dependencies, configuration, hooks)); }