close on listen bugfix

This commit is contained in:
waltem01 2022-06-30 12:48:21 +02:00
parent 98e34ab248
commit 8f2bb3a4e8

View File

@ -114,8 +114,10 @@ public static class Connection {
Socket other = own.EndAccept(AR);
listeners--;
other.BeginReceive(buffer, 0, buffer.Length, SocketFlags.None, new AsyncCallback(ReceiveCallback), other);
if (self == null)
if (self == null) {
self = other;
own.Close();
}
}
// Handle sending messages