470,648 Members | 1,480 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,648 developers. It's quick & easy.

Send all packets (socket programming)

Is there a way to make shure that all packets has been sent before issuing
a Shutdown and/or Close on a (TCP) Socket?

The problem is that "the other end" interprets a reset-flag (RST) on an IP-
packet as an indication of an error. Instead the finish-flag (FIN) must be
set, in order to close the connection non-errornously. That can be achieved
by using socket.shutdown(SHUT_RDWR) followed by socket.close().

BUT if all data has not been sent, sometimes shutdown(SHUT_RDWR) followed
by close(), sets RST, and the other end thinks that something went wrong
(the other end is some unknown TCP/IP printer) and goes to an error-state.

Jul 19 '05 #1
0 1567

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by ifmusic | last post: by
3 posts views Thread by Hiroyuki Tanaka | last post: by
2 posts views Thread by Deephazz | last post: by
3 posts views Thread by EricKit | last post: by
1 post views Thread by Korara | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.