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
Closing an abandoned ftp session
Re: Closing an abandoned ftp session
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()].
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
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.