private async Task PollAsync(Socket socket, int microSeconds) { // TODO: this is garbage #if false try { if (socket.Poll(microSeconds, SelectMode.SelectRead)) { Socket remote = await socket.AcceptFromAsync().ConfigureAwait(false); if (manager.Contains(remote.RemoteEndPoint)) { NetworkSession session = manager.Get(remote.RemoteEndPoint); await session.PollAndReceiveAllAsync(microSeconds).ConfigureAwait(false); return; } Logger.Info($"New connection from {remote.RemoteEndPoint}"); if (MaxConnections >= 0 && manager.Count >= MaxConnections) { Logger.Info("Max connections exceeded, denying new connection!"); remote.Close(); } else { Logger.Debug("Allowing new connection..."); NetworkSession session = _factory.Create(remote); await session.PollAndReceiveAllAsync(microSeconds).ConfigureAwait(false); manager.Add(session); } * / } } catch (SocketException e) { Logger.Error("Exception polling sockets!", e); } #endif await Task.Delay(0).ConfigureAwait(false); }