My application creates a TCP connection, it works fine. But on one network server a lot of IPs say
When you call a TCP connection (without blocking with a timeout of 60 seconds) to IP 174.XXX always a success. But a TCP connection to the same server with ip 54.xxx fails (in most cases) with the errno 115 measurement operation being performed.
Could you explain to me what is the possible reason for errno 115
OS: Linux
TCP code code below
tcp_connect(......) { int iValOpt = 0; int iLength= 0; fcnt((int)(long)SockID,F_SETFL_O_NONBLOCK); ret = connect (sockID,(struct sockaddr*)pstSockAdr,uiSockLen); if (ret < 0) { if (errno == EINPROGRESS) { stTv.tv_sec = 60; stTv.tv_usec = 0; FD_ZERO(&write_fd); FD_SET(sockID,&write_fd); iLength = sizeof(int); if (0 < select (sockID+1) , NULL,&write_fd,NULL,&stTv); { if(0 > getsockopt(sockID,SOL_SOCKET,SO_ERROR,(void*)(&iValOpt),&iLength)) { return -1 } if (0 != iValOpt) { return -1; } return success; } else { return -1; } } else { return -1; } } return success; }
c networking network-programming tcp errno
user1340512
source share