PIEthernet timeout on Windows fix
git-svn-id: svn://db.shs.com.ru/pip@138 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -300,11 +300,15 @@ void PIEthernet::applyTimeouts() {
|
|||||||
|
|
||||||
void PIEthernet::applyTimeout(int fd, int opt, double ms) {
|
void PIEthernet::applyTimeout(int fd, int opt, double ms) {
|
||||||
if (fd == 0) return;
|
if (fd == 0) return;
|
||||||
|
//piCoutObj << "setReadIsBlocking" << yes;
|
||||||
|
#ifdef WINDOWS
|
||||||
|
DWORD tm = ms;
|
||||||
|
#else
|
||||||
double s = ms / 1000.;
|
double s = ms / 1000.;
|
||||||
timeval tm;
|
timeval tm;
|
||||||
tm.tv_sec = piFloord(s); s -= tm.tv_sec;
|
tm.tv_sec = piFloord(s); s -= tm.tv_sec;
|
||||||
tm.tv_usec = s * 1000000.;
|
tm.tv_usec = s * 1000000.;
|
||||||
//piCoutObj << "setReadIsBlocking" << yes;
|
#endif
|
||||||
ethSetsockopt(fd, SOL_SOCKET, opt, &tm, sizeof(tm));
|
ethSetsockopt(fd, SOL_SOCKET, opt, &tm, sizeof(tm));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user