KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
My application creats a TCP connection, This is working normaly. But in one network server has many IP say 174.X.X.X 54.x.x.x like this When calling TCP connect (Non blocking with timeout of 60 seconds) to IP 174.X.X.X is always success . But TCP connect to same server with ip 54.x.x.x is failing (most of the times) with errno 115 measn operation in progress. Can you please explain me what are the possible reason for errno 115 OS : Linux My TCP conenct code is as 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; }
Tags (comma-separated)
Save Edits
Cancel