From 7f473fe58411e96d3d53a94ad67a6ad472e0541b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Wed, 27 May 2015 16:49:14 +0000 Subject: [PATCH] PIEthernet timeout on Windows fix git-svn-id: svn://db.shs.com.ru/pip@138 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src/io/piethernet.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/io/piethernet.cpp b/src/io/piethernet.cpp index 635748bf..43fc5199 100755 --- a/src/io/piethernet.cpp +++ b/src/io/piethernet.cpp @@ -300,11 +300,15 @@ void PIEthernet::applyTimeouts() { void PIEthernet::applyTimeout(int fd, int opt, double ms) { if (fd == 0) return; + //piCoutObj << "setReadIsBlocking" << yes; +#ifdef WINDOWS + DWORD tm = ms; +#else double s = ms / 1000.; timeval tm; tm.tv_sec = piFloord(s); s -= tm.tv_sec; tm.tv_usec = s * 1000000.; - //piCoutObj << "setReadIsBlocking" << yes; +#endif ethSetsockopt(fd, SOL_SOCKET, opt, &tm, sizeof(tm)); }