[MLton] Socket.connectNB on NetBSD

Stephen Weeks MLton@mlton.org
Tue, 18 Nov 2003 13:40:12 -0800


Thanks to all Jesper's work and to my finally setting up a NetBSD
machine, I am now able to run all the regressions for MLton on
NetBSD.  After fixing one problem with Real.split, the only remaining
failure is in socket.sml.  This fails because of strange behavior of
Socket.connectNB, which is succeeding when it should be failing.

Here's a simple test program that should pring "OK", but instead
prints "WRONG" on NetBSD.  Jesper, can you figure out what's going
wrong?

--------------------------------------------------------------------------------

val addr = INetSock.any 0
val socket = INetSock.TCP.socket ()
val _ = Socket.bind (socket, addr)
val _ = Socket.listen (socket, 5)
val addr = Socket.Ctl.getSockName socket

val socket' = INetSock.TCP.socket ()
val _ =
   print (if Socket.connectNB (socket', addr)
	     then "WRONG\n"
	  else "OK\n")