Closing an abandoned ftp session

Discussion to talk about software related topics only.
Post Reply
nirias999
Posts: 10
Joined: Thu Apr 24, 2008 3:36 pm

Closing an abandoned ftp session

Post 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
greengene
Posts: 164
Joined: Wed May 14, 2008 11:20 am
Location: Lakeside, CA

Re: Closing an abandoned ftp session

Post 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()].
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Closing an abandoned ftp session

Post 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.
Post Reply