diff --git a/std/hl/_std/sys/ssl/Socket.hx b/std/hl/_std/sys/ssl/Socket.hx index f16818b9f14..d8fa1b39424 100644 --- a/std/hl/_std/sys/ssl/Socket.hx +++ b/std/hl/_std/sys/ssl/Socket.hx @@ -50,7 +50,10 @@ private class SocketInput extends haxe.io.Input { __s.handshake(); var r = @:privateAccess __s.ssl.recv(buf, pos, len); if (r == -1) - throw haxe.io.Error.Blocked; + if (@:privateAccess __s.isBlocking) + return 0 + else + throw haxe.io.Error.Blocked; else if (r <= 0) throw new haxe.io.Eof(); return r; @@ -85,7 +88,10 @@ private class SocketOutput extends haxe.io.Output { __s.handshake(); var r = @:privateAccess __s.ssl.send(buf, pos, len); if (r == -1) - throw haxe.io.Error.Blocked; + if (@:privateAccess __s.isBlocking) + return 0 + else + throw haxe.io.Error.Blocked; else if (r < 0) throw new haxe.io.Eof(); return r;