/// <summary> /// When a new connection is established, we the parent class are responsible /// for handling the processing /// </summary> /// <param name="Stream">A GamespyTcpStream object that wraps the I/O AsyncEventArgs and socket</param> protected override void ProcessAccept(GamespyTcpStream Stream) { // Get our connection id int ConID = Interlocked.Increment(ref ConnectionCounter); GpcmClient client; try { // Create a new GpcmClient, passing the IO object for the TcpClientStream client = new GpcmClient(Stream, ConID); Processing.TryAdd(ConID, client); // Begin the asynchronous login process client.SendServerChallenge(); } catch (Exception e) { // Log the error L.LogError("WARNING: An Error occured at [GpcmServer.ProcessAccept] : Generating Exception Log"); ExceptionHandler.GenerateExceptionLog(e); // Remove pending connection Processing.TryRemove(ConID, out client); // Release this stream so it can be used again base.Release(Stream); } }
/// <summary> /// When a new connection is established, we the parent class are responsible /// for handling the processing /// </summary> /// <param name="Stream">A GamespyTcpStream object that wraps the I/O AsyncEventArgs and socket</param> protected override void ProcessAccept(GamespyTcpStream Stream) { // Get our connection id int ConID = Interlocked.Increment(ref ConnectionCounter); GpcmClient client; try { // Create a new GpcmClient, passing the IO object for the TcpClientStream client = new GpcmClient(Stream, ConID); Processing.TryAdd(ConID, client); // Begin the asynchronous login process client.SendServerChallenge(); } catch (Exception e) { // Log the error Program.ErrorLog.Write("WARNING: An Error occured at [GpcmServer.ProcessAccept] : Generating Exception Log"); ExceptionHandler.GenerateExceptionLog(e); // Remove pending connection Processing.TryRemove(ConID, out client); // Release this stream so it can be used again base.Release(Stream); } }