Problem in FTP server, need to close socket asap.
‎11-27-2007
12:17 PM
1,432 Views
Nilson
Contributor I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, there is my problem...
I have a ftp server listen on port 21 and another socket listen on port 5000. Port 5000 gets data from a PABX and writes in a flash.
When the flash is full, i need to close the port 5000 socket asap so i dont lose data, but what is happening is when i tell the port 5000 socket to close it takes some time and it doesnt stop to get data from pabx, so i lose data and there is a worst thing happening, the tcp buffers get full and everything stops working.
How do i clean those tcp buffers after i close the socket? Theres a way to close the socket immediatly?
Thanks.
2 Replies
‎11-27-2007
01:35 PM
561 Views
Nilson
Contributor I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh well, i thought i would have more trouble to solve this.
Setting the socket flags to as below did the job.
pabx_server_socket->so_options = SO_LINGER;
pabx_server_socket->linger = 0;
pabx_server_socket->linger = 0;
pabx_communication_socket->so_options = SO_LINGER;
pabx_communication_socket->linger = 0;
pabx_communication_socket->linger = 0;
‎11-27-2007
05:11 PM
561 Views
macl
Senior Contributor I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just a friendly reminder, please include the product # in the subject line so everyone knows which device your are programming.
Thanks,
macl