Changeset 971
- Timestamp:
- 11/10/2006 22:58:41 (5 years ago)
- File:
-
- 1 edited
-
box/chris/general/lib/server/SocketStreamTLS.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/chris/general/lib/server/SocketStreamTLS.cpp
r582 r971 24 24 #include "ServerException.h" 25 25 #include "TLSContext.h" 26 #include "BoxTime.h" 26 27 27 28 #include "MemLeakFindOn.h" … … 245 246 } 246 247 p.revents = 0; 247 switch(::poll(&p, 1, (Timeout == IOStream::TimeOutInfinite)?INFTIM:Timeout)) 248 249 int64_t start, end; 250 start = BoxTimeToMilliSeconds(GetCurrentBoxTime()); 251 end = start + Timeout; 252 int result; 253 254 do 255 { 256 int64_t now = BoxTimeToMilliSeconds(GetCurrentBoxTime()); 257 int poll_timeout = (int)(end - now); 258 if (poll_timeout < 0) poll_timeout = 0; 259 if (Timeout == IOStream::TimeOutInfinite) 260 { 261 poll_timeout = INFTIM; 262 } 263 result = ::poll(&p, 1, poll_timeout); 264 } 265 while(result == -1 && errno == EINTR); 266 267 switch(result) 248 268 { 249 269 case -1: 250 // error 251 if(errno == EINTR) 252 { 253 // Signal. Do "time out" 254 return false; 255 } 256 else 257 { 258 // Bad! 259 THROW_EXCEPTION(ServerException, SocketPollError) 260 } 270 // error - Bad! 271 THROW_EXCEPTION(ServerException, SocketPollError) 261 272 break; 262 273
Note: See TracChangeset
for help on using the changeset viewer.
