Suppose the following situation:
- Create a ZnClient
- Pass in an explicit timeout (e.g., 3 seconds)
- Pass in a host/port combination that does not exist
Expected behavior: an error should be thrown after 3 seconds.
What happens: the user has to wait for the (default) timeout of GsSocket; the timeout passed in to the client is ignored.
Reason: the SocketStream does not use the timeout while connecting to the socket created via SocketStreamSocket.
In the code this is reflected in the following extension method
SocketStream>>openConnectionToHost: host port: portNumber timeout: timeout
| socket |
socket :=SocketStreamSocket newTCPSocket.
socket connectTo: host port: portNumber.
^(self on: socket)
timeout: timeout;
yourself
I compared this with the Pharo implementation, and here the timeout is passed.