Re: after opening socket, sending data then closing socket 3000 times i get "Only one usage of each socket address"
From: Mike Blake-Knox (mikebkdont_at_spamintrex.net)
Date: 02/12/05
- Next message: Herve Bocuse: "Mysteries of a font in the PropertyGrid..."
- Previous message: Ivan Zuzak: ""Com object with CLSID {...} is either not valid or not registered.""
- In reply to: Daniel: "Re: after opening socket, sending data then closing socket 3000 times i get "Only one usage of each socket address""
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 12 Feb 2005 09:53:14 EST
In article <#j3Srx9DFHA.3840@tk2msftngp13.phx.gbl>, Daniel wrote:
> i wrote a c version of this using c sockets and i did not have this issue.
> it seems that after the socket is closed it is not realy closed. i looked in
> a tcp viewer and it shows the sockets staying open for about 60 seconds
> after i close them, after 3000 it starts to error because they are all in
> use when they should disapear right after i close socket unless im missing a
> step? or is this a bug w/ TcpClient? any work around appreciated.
TCP sockets don't close instantly. When you execute a close(), the closing is
only started (but not completed) before control is returned to your code. If
you were to use the netstat command you can see the state of the sockets on
your computer.
Take a look at http://tangentsoft.net/wskfaq/articles/debugging-tcp.html for
moe details.
Mike
- Next message: Herve Bocuse: "Mysteries of a font in the PropertyGrid..."
- Previous message: Ivan Zuzak: ""Com object with CLSID {...} is either not valid or not registered.""
- In reply to: Daniel: "Re: after opening socket, sending data then closing socket 3000 times i get "Only one usage of each socket address""
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|