changing send, rc timeout

This commit is contained in:
Dhanya Maliakal
2016-11-01 11:09:28 +01:00
parent 434fa863d0
commit d6e78c19ad

View File

@ -473,13 +473,13 @@ enum communicationProtocol{
//cout << "socketdescriptor "<< socketDescriptor << endl; //cout << "socketdescriptor "<< socketDescriptor << endl;
struct timeval tout; struct timeval tout;
tout.tv_sec = 0; tout.tv_sec = 0;
tout.tv_usec = 0; tout.tv_usec = 500;//0;
if(::setsockopt(socketDescriptor, SOL_SOCKET, SO_RCVTIMEO, &tout, sizeof(struct timeval)) <0) if(::setsockopt(socketDescriptor, SOL_SOCKET, SO_RCVTIMEO, &tout, sizeof(struct timeval)) <0)
{ {
cerr << "Error in setsockopt SO_RCVTIMEO "<< 0 << endl; cerr << "Error in setsockopt SO_RCVTIMEO "<< 0 << endl;
} }
tout.tv_sec = ts; tout.tv_sec = 0;//ts;
tout.tv_usec = 0; tout.tv_usec = 500;//0;
if(::setsockopt(socketDescriptor, SOL_SOCKET, SO_SNDTIMEO, &tout, sizeof(struct timeval)) < 0) if(::setsockopt(socketDescriptor, SOL_SOCKET, SO_SNDTIMEO, &tout, sizeof(struct timeval)) < 0)
{ {
cerr << "Error in setsockopt SO_SNDTIMEO " << ts << endl; cerr << "Error in setsockopt SO_SNDTIMEO " << ts << endl;