Try to use CAsyncSocket, it is an asynchonism socket.
And, why do you use a "while" loop? It always send the data , and there is no opportunity to receive data.
No taboo from the fat man!
I speculate that maybe, some signal handlers in your program catch and ignore the SIGINT, SIGTERM etc.
As the description above , you can remove the zombie process now, but I suggest you to find out the cause, it is important, I think.
5. I suggest that you may find a tool, such as 'sniffer','snort', running it in you LAN, and catch the packets ,analysing the whole ethernet frame. Then you can have a deep knowledge about TCP/IP.
As I know, in the serve side (passive closed)
ESTABLISH(receive FIN, send ACK)->CLOSE_WAIT(Application close the FD)->LASE_ACK(receive ACK)->CLOSE
So ,if your application comes into CLOSE_WAIT, that means your application does not close the relevant FD(socket)in time.
Check your application...
Or you might try Squid(www.squid-cache.org).Although it is so huge and great , the content you may concern is simple.Try download the 2.4.x release and find the watch_child() function in main.c file.
if (ioctl(fd, BLKGETSIZE, ¡±ors))return -1;
if (ioctl(fd, BLKSSZGET, ¡±or_size))return -1;
may be:
if (ioctl(fd, BLKGETSIZE,§ors))
return ;
if (ioctl(fd, BLKSSZGET,§or_size))
return ;
memset:
MEMSET(3) Linux Programmer's Manual MEMSET(3)
NAME
memset - fill memory with a constant byte
SYNOPSIS
#include <string.h>
void *memset(void *s, int c, size_t n);
DESCRIPTION
The memset() function fills the first n bytes of the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.