By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,985 Members | 1,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,985 IT Pros & Developers. It's quick & easy.

Problem with Closing TCP connection

P: n/a
Dear All,

I am currently developing a tool using Python 2.4.2 which will be used
as a sink to pump TCP messages. During which i have observed that the
TCP close interface provided by Python is not closing the connection.
This i confirmed by looking at the ethereal logs, which show proper 3
way FIN ACK Handshake. But the netstat reports TIME_WAIT state for the
TCP connection, which is hindering the messages to be pumped later. I
would like to know whether the problem exists Python close and is
there is turnaround? to the mentioned problem.

Thanks,

Madhur

May 5 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 5 May, 12:18, Madhur <madhurr...@gmail.comwrote:
[...]
as a sink to pump TCP messages. During which i have observed that the
TCP close interface provided by Python is not closing the connection.
This i confirmed by looking at the ethereal logs, which show proper 3
way FIN ACK Handshake. But the netstat reports TIME_WAIT state for the
TCP connection, which is hindering the messages to be pumped later. I
would like to know whether the problem exists Python close and is
there is turnaround? to the mentioned problem.
IIRC, this is normal operation of TCP connections. A very short
explanation is here (http://www.unixguide.net/network/socketfaq/
2.7.shtml).
So it is not a problem of Python.
I don't know exactly what you want to do, but I suggest you look at
one of the following options:
- Either get IP messages and filter them, same way as ethereal.
Probably complicated coding.
- Depending on your problem, you may try opening the TCP socket in
Python using the SO_REUSEADDR option.

Regards,
k

May 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.