From: SourceForge.net <no...@so...> - 2008-06-30 19:28:20
|
Bugs item #2007052, was opened at 2008-06-30 15:28 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=2007052&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: lisp error Status: Open Resolution: None Priority: 5 Private: No Submitted By: Sam Steingold (sds) Assigned to: Sam Steingold (sds) Summary: socket-connect with :timeout to a dead port Initial Comment: <http://article.gmane.org/gmane.lisp.clisp.general/12286> Executing (socket:socket-connect port-that-no-one-listens-to "localhost") raises "connection refused" as expected, but (socket:socket-connect port-that-no-one-listens-to "localhost" :timeout 30) exits normally without waiting, and returns a socket. I expected: o To wait for a connection until time ends and raise 'timeout' -or- o To raise connection refused in the begining. but it just silently completes without waiting. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=2007052&group_id=1355 |
From: SourceForge.net <no...@so...> - 2008-06-30 19:29:03
|
Bugs item #2007052, was opened at 2008-06-30 15:28 Message generated for change (Comment added) made by sds You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=2007052&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: lisp error Status: Open Resolution: None Priority: 5 Private: No Submitted By: Sam Steingold (sds) Assigned to: Sam Steingold (sds) Summary: socket-connect with :timeout to a dead port Initial Comment: <http://article.gmane.org/gmane.lisp.clisp.general/12286> Executing (socket:socket-connect port-that-no-one-listens-to "localhost") raises "connection refused" as expected, but (socket:socket-connect port-that-no-one-listens-to "localhost" :timeout 30) exits normally without waiting, and returns a socket. I expected: o To wait for a connection until time ends and raise 'timeout' -or- o To raise connection refused in the begining. but it just silently completes without waiting. ---------------------------------------------------------------------- >Comment By: Sam Steingold (sds) Date: 2008-06-30 15:29 Message: Logged In: YES user_id=5735 Originator: YES <http://article.gmane.org/gmane.lisp.clisp.general/12287> this behavior is indeed wrong. apparently, now connect() returns EINPROGRESS even on bad connections. please try this patch: --- socket.d.~1.111.~ 2007-11-26 11:42:16.000000000 -0500 +++ socket.d 2008-06-30 11:50:37.000569000 -0400 @@ -1008,6 +1008,13 @@ local SOCKET connect_via_ip (struct sock if (sock_errno_is(EINTR)) goto restart_select; saving_sock_errno(CLOSESOCKET(fd)); return INVALID_SOCKET; } + var CLISP_SOCKLEN_T len = sizeof(ret); + if (getsockopt(fd,SOL_SOCKET,SO_ERROR,&ret,&len) < 0) + OS_error(); + if (ret) { + sock_set_errno(ret); + return INVALID_SOCKET; + } } #endif if (ret == 0) { with it, I see this: [1]> (socket:socket-connect 12345 "localhost" :timeout 30) *** - UNIX error 111 (ECONNREFUSED): Connection refused The following restarts are available: ABORT :R1 Abort main loop Break 1 [2]> [3]> (socket:socket-connect 12345 "localhost" :timeout 0) #<IO INPUT-BUFFERED SOCKET-STREAM CHARACTER localhost:12345> [4]> (read-line *) *** - UNIX error 111 (ECONNREFUSED): Connection refused The following restarts are available: ABORT :R1 Abort main loop Break 1 [5]> note that with timeout of 0 the socket is still created as documented. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=2007052&group_id=1355 |
From: SourceForge.net <no...@so...> - 2008-06-30 19:33:12
|
Bugs item #2007052, was opened at 2008-06-30 15:28 Message generated for change (Comment added) made by sds You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=2007052&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: lisp error >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Sam Steingold (sds) Assigned to: Sam Steingold (sds) Summary: socket-connect with :timeout to a dead port Initial Comment: <http://article.gmane.org/gmane.lisp.clisp.general/12286> Executing (socket:socket-connect port-that-no-one-listens-to "localhost") raises "connection refused" as expected, but (socket:socket-connect port-that-no-one-listens-to "localhost" :timeout 30) exits normally without waiting, and returns a socket. I expected: o To wait for a connection until time ends and raise 'timeout' -or- o To raise connection refused in the begining. but it just silently completes without waiting. ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2008-06-30 15:33 Message: Logged In: YES user_id=5735 Originator: YES thank you for your bug report. the bug has been fixed in the CVS tree. you can either wait for the next release (recommended) or check out the current CVS tree (see http://clisp.cons.org) and build CLISP from the sources (be advised that between releases the CVS tree is very unstable and may not even build on your platform). ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2008-06-30 15:29 Message: Logged In: YES user_id=5735 Originator: YES <http://article.gmane.org/gmane.lisp.clisp.general/12287> this behavior is indeed wrong. apparently, now connect() returns EINPROGRESS even on bad connections. please try this patch: --- socket.d.~1.111.~ 2007-11-26 11:42:16.000000000 -0500 +++ socket.d 2008-06-30 11:50:37.000569000 -0400 @@ -1008,6 +1008,13 @@ local SOCKET connect_via_ip (struct sock if (sock_errno_is(EINTR)) goto restart_select; saving_sock_errno(CLOSESOCKET(fd)); return INVALID_SOCKET; } + var CLISP_SOCKLEN_T len = sizeof(ret); + if (getsockopt(fd,SOL_SOCKET,SO_ERROR,&ret,&len) < 0) + OS_error(); + if (ret) { + sock_set_errno(ret); + return INVALID_SOCKET; + } } #endif if (ret == 0) { with it, I see this: [1]> (socket:socket-connect 12345 "localhost" :timeout 30) *** - UNIX error 111 (ECONNREFUSED): Connection refused The following restarts are available: ABORT :R1 Abort main loop Break 1 [2]> [3]> (socket:socket-connect 12345 "localhost" :timeout 0) #<IO INPUT-BUFFERED SOCKET-STREAM CHARACTER localhost:12345> [4]> (read-line *) *** - UNIX error 111 (ECONNREFUSED): Connection refused The following restarts are available: ABORT :R1 Abort main loop Break 1 [5]> note that with timeout of 0 the socket is still created as documented. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=2007052&group_id=1355 |