Open romamik opened 8 years ago
I think this has been discussed/resolved elsewhere, but I can't remember where/how. Please see if we can close this.
This seems hxcpp specific, and it calls for proper sys unit tests.
@hughsando can you have a look ?
neko has the same error . https://community.haxe.org/t/socket-was-blocked-need-help/792/2
So, non-blocking io should throw an instance of Error, the 'Blocked' enum, rather than the "Blocking" string? Seems sensible, and I'm happy to change if that is the official word.
Yes, "Blocking" string should not happen at user level.
Bump, this still happens on C++ :
socket.setBlocking(false);
socket.listen(1);
socket.accept();
Output :
Error : Blocking
Sockets blocking operations in non-blocking mode throw something strange. Documentation says:
http://api.haxe.org/sys/net/Socket.html
http://api.haxe.org/haxe/io/Error.html
It looks like a typo in documentation: Blocked vs Blocking. But both parts of documentation are correct. Sockets really throws 'Blocking' and Error really only have 'Blocked'.