by Alfonso Ferrandez posted on 2005/04/21 |
|
Hi there,
I have been exploring your full Proxy application, particularly when used as an FTP Proxy. One thing I've noticed is that when a DataConnection is created (at least vias PASV command) after the connection is closed by both server and client, the Proxy keeps it opened and actively listening (can see it by doing a "netstat -an"). Of course, if the number of avaialble ports for data connections is limited to a few, we soon hit the problem of Socket.Bind() excepting since the port is already in use from the previous run.
I've looked at the code and the ShutDown() and Close() calls are called correctly yet the port remains active. Has anybody seen this before? And does anybody have a resolution for it?
Thanks!
AL |
by Alfonso Ferrandez posted on 2005/04/25 |
Reply |
I resolved the issue. It looks like when using a PORT command, the ListenSocket is Closed and nullified after AcceptConnect is called. This was not the case for PASV so it was leaving the ListenSocket active, which meant you couldn't reuse that port later on.
Cheers!
AL |