Page 1 of 1

Closing an abandoned ftp session

Posted: Tue Jul 13, 2010 12:30 pm
by nirias999
I have a MOD5272 with one task running as an ftp server. If a client connects and then goes idle (as opposed to closing the connection) I want the server to end that client session after 60 seconds or so of inactivity.

I see the FTPDSessionEnd() handler that allows me to do housekeeping tasks after the client computer closes the session, but I dont see any api allowing the session end to be initiated by one of my tasks running on the netburner.

Does anyone have any sample code showing how that might be accomplished?

thanks

Re: Closing an abandoned ftp session

Posted: Wed Jul 14, 2010 1:43 pm
by greengene
a crude way would be to shutdown the server and open it up again with FTPDStopReq() and FTPStart().

another would be to extern the FTPDSess table, and use that to get the session index associated with your
session ip and then do the processing of the QUITFunc() [w/o the writestring()].

Re: Closing an abandoned ftp session

Posted: Thu Jul 15, 2010 12:37 pm
by rnixon
How about implementing a timeout for the sockets, so if any socket is idle for a specified period of time, the application calls close() on that socket? That is the way most servers handle a half-open socket issue.