What's the reason of this segmentation fault?
问题 It doesn't happen always,but will happen when the server application has been running for quite a while. What's the reason and how can I fix it? Code as follows: struct hostent* Host; Result->sin_family=AF_INET; Result->sin_port=htons((unsigned short)Port); Host=gethostbyname(HostName); if(!Host) { unsigned long int addr=inet_addr(HostName); if(addr!=-1) Host=gethostbyaddr(&addr,sizeof(addr),AF_INET); if(!Host) { if(errno!=ETIMEDOUT) errno=-1; /* use h_errno */ printf("Unknown host for server