MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / Poll

Method Poll

sourcecommon/udp.cpp:500–519  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

498}
499//---------------------------------------------------------------------------
500bool TUDP::Poll(bool bread, bool bwrite, bool berror, long msec)
501{
502 WSAError = 0;
503 fd_set f;
504 FD_ZERO(&f);
505 FD_SET(handle, &f);
506 timeval t;
507 t.tv_sec = 0;
508 t.tv_usec = msec * 1000; // "POLL" SOCKET STATE msec period and return immediately...
509 int rv = select(FD_SETSIZE, bread ? &f : NULL, bwrite ? &f : NULL, berror ? &f : NULL, &t);
510 if( rv == SOCKET_ERROR )
511 {
512 WSAError = WSAGetLastError();
513 Error = 1;
514 bytes = 0;
515 if( Exceptions ) throw 0;
516 return !Error;
517 }
518 return rv > 0;
519}
520//---------------------------------------------------------------------------
521// �������� �������� �����
522// ���������� - ������� ������� �������

Callers 1

TcpReceiveMessageFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected