WaitForSend Waits up til the specified time to see if the connection is ready to send data if it is then it will return UTE_SUCCESS Params secs - max. seconds to wait uSecs - max. micro seconds to wait Return UTE_SUCCESS - error UTE_ERROR - success ****************************************************/
| 1078 | UTE_ERROR - success |
| 1079 | ****************************************************/ |
| 1080 | int CUT_WSClient::WaitForSend(long secs,long uSecs){ |
| 1081 | |
| 1082 | fd_set writeSet{}; |
| 1083 | struct timeval tv{}; |
| 1084 | |
| 1085 | tv.tv_sec = secs; |
| 1086 | tv.tv_usec =uSecs; |
| 1087 | |
| 1088 | FD_ZERO(&writeSet); |
| 1089 | |
| 1090 | FD_SET(m_socket,&writeSet); |
| 1091 | |
| 1092 | //wait up to the specified time to see if data is avail |
| 1093 | if( select(-1,NULL,&writeSet,NULL,&tv)!= 1){ |
| 1094 | return OnError(UTE_ERROR); |
| 1095 | } |
| 1096 | return OnError(UTE_SUCCESS); |
| 1097 | } |
| 1098 | |
| 1099 | /*********************************************** |
| 1100 | SendTo |
nothing calls this directly
no outgoing calls
no test coverage detected