当前位置: 技术问答>linux和unix
关于SOCKET释放端口的问题!!!
来源: 互联网 发布时间:2015-07-16
本文导语: signal(SIGCLD,SIG_IGN); while(1) { memset(&addr_client, 0, sizeof(addr_client)); inaddrlen = sizeof(struct sockaddr_in); sockClient = accept(socklisten,(struct sockaddr*)(&addr_client),&inaddrlen); if(sockClient==-1) { ...
signal(SIGCLD,SIG_IGN);
while(1)
{
memset(&addr_client, 0, sizeof(addr_client));
inaddrlen = sizeof(struct sockaddr_in);
sockClient = accept(socklisten,(struct sockaddr*)(&addr_client),&inaddrlen);
if(sockClient==-1)
{
WriteLogFile("Error on accept of socklisten.n");
}
memset(szIp, 0, sizeof(szIp));
sprintf(szIp,"%s",inet_ntoa(addr_client.sin_addr));
while( ReadSequence(SEQUTYPE)
while(1)
{
memset(&addr_client, 0, sizeof(addr_client));
inaddrlen = sizeof(struct sockaddr_in);
sockClient = accept(socklisten,(struct sockaddr*)(&addr_client),&inaddrlen);
if(sockClient==-1)
{
WriteLogFile("Error on accept of socklisten.n");
}
memset(szIp, 0, sizeof(szIp));
sprintf(szIp,"%s",inet_ntoa(addr_client.sin_addr));
while( ReadSequence(SEQUTYPE)