Stopping FTP session

Hi,
i wrote an FTP application. Trying to close the application while
preforming FTP didn't work. Is there any method that close the FTP
session ?

Thanks

Ofer