Try to read instead of write from a TCP connection. This gives 'Connection refused' instead of 'Broken pipe', which is much more useful.

db4
Doug Coleman 2011-08-26 11:03:01 -05:00
parent 32261681f8
commit b7314a68d8
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ M: object (get-remote-address) ( handle local -- sockaddr )
SOL_SOCKET SO_OOBINLINE set-socket-option ;
: wait-to-connect ( port -- )
dup handle>> handle-fd f 0 write
dup handle>> handle-fd f 0 read
{
{ [ 0 = ] [ drop ] }
{ [ errno EAGAIN = ] [ dup +output+ wait-for-port wait-to-connect ] }