Closed GoogleCodeExporter closed 8 years ago
It is because TWS doesn't immediately end the conversation after
ib/ext/EClientSocket.py line 168:
m_socket.close()
If we have
m_socket.shutdown(socket.SHUT_RDWR)
m_socket.close()
then the TWS should end the conversation immediately, and subsequent connection
will
work just fine.
Original comment by yichun....@gmail.com
on 7 Jan 2008 at 1:19
According to
http://www.amk.ca/python/howto/sockets/sockets.html#SECTION000500000000000000000
"""Strictly speaking, you're supposed to use shutdown on a socket before you
close
it. The shutdown is an advisory to the socket at the other end. Depending on the
argument you pass it, it can mean "I'm not going to send anymore, but I'll still
listen", or "I'm not listening, good riddance!". Most socket libraries,
however, are
so used to programmers neglecting to use this piece of etiquette that normally a
close is the same as shutdown(); close(). So in most situations, an explicit
shutdown
is not needed.
"""
Python's socket module might do things more politely. Of course I do not know
what
happens when java client called socket.close(), but seems it may not need a
.shutdown()...
Original comment by yichun....@gmail.com
on 7 Jan 2008 at 3:22
Fix in r292, needs verification.
Original comment by troy.mel...@gmail.com
on 5 Feb 2008 at 8:48
Closing without verification.
Original comment by troy.mel...@gmail.com
on 11 May 2008 at 3:23
This issue is again reproducible in the latest version.
Original comment by ritabr...@gmail.com
on 7 Jul 2015 at 10:54
Original issue reported on code.google.com by
yichun....@gmail.com
on 7 Jan 2008 at 1:16