diff --git a/src/haxe/net/impl/SocketSys.hx b/src/haxe/net/impl/SocketSys.hx index b8450ca..7a61597 100644 --- a/src/haxe/net/impl/SocketSys.hx +++ b/src/haxe/net/impl/SocketSys.hx @@ -57,6 +57,7 @@ class SocketSys extends Socket2 { override public function close() { this.impl.close(); + isClosed = true; if (!wasCloseSent) { wasCloseSent = true; @@ -110,7 +111,7 @@ class SocketSys extends Socket2 { } } - if (needClose) { + if (needClose && !isClosed) { close(); } }