Fix for issue #145

This commit is contained in:
sta 2015-07-24 14:04:21 +09:00
parent 0be4389d97
commit 196f5d92a1

View File

@ -252,9 +252,18 @@ namespace WebSocketSharp.Net
args.AcceptSocket = null; args.AcceptSocket = null;
} }
var ret = true;
try { try {
ret = lsnr._socket.AcceptAsync (args); while (!lsnr._socket.AcceptAsync (args)) {
if (sock != null) {
processAccepted (sock, lsnr);
sock = null;
}
if (args.SocketError == SocketError.Success) {
sock = args.AcceptSocket;
args.AcceptSocket = null;
}
}
} }
catch { catch {
if (sock != null) if (sock != null)
@ -265,9 +274,6 @@ namespace WebSocketSharp.Net
if (sock != null) if (sock != null)
processAccepted (sock, lsnr); processAccepted (sock, lsnr);
if (!ret)
onAccept (sender, e);
} }
private static void processAccepted (Socket socket, EndPointListener listener) private static void processAccepted (Socket socket, EndPointListener listener)