News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Miscellaneous Forum
 
Proxy App does not close sockets correctly

Reply

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

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.