Skip to content

Commit

Permalink
Fix listen socket stopping listening
Browse files Browse the repository at this point in the history
Caused by bf61635
  • Loading branch information
bm01 committed Nov 7, 2024
1 parent 616d073 commit e306741
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CoreBase/Network/BaseServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,17 @@ void FreeBufferPosition()

void OnAsyncListenCompletion(object sender, SocketAsyncEventArgs listenArgs)
{
if (_listen == null || listenArgs.SocketError is SocketError.ConnectionReset)
if (_listen == null)
return;

BaseClient baseClient = null;
Socket socket = listenArgs.AcceptSocket;

try
{
if (listenArgs.SocketError is SocketError.ConnectionReset)
return;

baseClient = GetNewClient(socket);
baseClient.Receive();
baseClient.OnConnect();
Expand Down

0 comments on commit e306741

Please sign in to comment.