It's not actually a bug with Socket.connectNB. There was a bug in
NetHostDB.scan and NetHostDB.fromString which meant that IP addresses
such as 127.0.0.1 were not handled correctly. This was fixed in git
master in commit 0d050ae45. You can work around the problem using
NetHostDB.getByName "localhost".
David
On 20/06/2016 10:21, Kostirya wrote:
Hello, all.
Socket.connectNB behaves oddly in Poly/ML.
We get raise SysErr immediately after Socket.connectNB to a non-existent
server.
However, it is a nonblocking connect, so we should get information about
unsuccesful connecton only after socket access.
The source code is attached and here is the results for Poly/ML:
./a.out
exc in 2 socket: SysErr ("Connection refused", SOME ECONNREFUSED)
exc in 3 socket: SysErr ("Connection refused", SOME ECONNREFUSED)
exc in 4 socket: SysErr ("Connection refused", SOME ECONNREFUSED)
.
.
^C
./a.out
exc in 1 socket: SysErr ("Connection refused", SOME ECONNREFUSED)
exc in 2 socket: SysErr ("Connection refused", SOME ECONNREFUSED)
exc in 3 socket: SysErr ("Connection refused", SOME ECONNREFUSED)
exc in 4 socket: SysErr ("Connection refused", SOME ECONNREFUSED)
.
.
^C
We usually get errors in this situation. I've tested on Linix and FreeBSD.
MLton and SML/NY don't get errors in the same situation.
NIck.
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml