private void ProcessListener() { TickManager tickManager = new TickManager(500, (TickManager.TickDelegate)(() => this._serverSocket.CheckAcceptClient())); while (true) { tickManager.Tick(); } }
private void ProcessWriter(object indexObject) { int index = (int)indexObject; TickManager tickManager = new TickManager(5000, (TickManager.TickDelegate)(() => { foreach (ServersideSession serversideSession in (IEnumerable <ServersideSession>) this._peers[index].Values) { serversideSession?.Socket.ProcessWrite(); } })); while (true) { tickManager.Tick(); } }
private void ProcessSingle() { TickManager tickManager = new TickManager(5000, (TickManager.TickDelegate)(() => { foreach (ServersideSession serversideSession in (IEnumerable <ServersideSession>) this._peers[0].Values) { if (serversideSession != null) { serversideSession.Socket.ProcessWrite(); serversideSession.Socket.ProcessRead(); } } this._serverSocket.CheckAcceptClient(); })); while (true) { tickManager.Tick(); } }