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

Method GetClient

sourcecommon/tcpserv.cpp:350–371  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

348}
349//---------------------------------------------------------------------------
350MSocket * MTCPServer::GetClient(long timetowait)
351{
352 MSocket * p = NULL;
353 errcode = 0;
354 if( Poll(true, false, false, timetowait) )
355 {
356 struct sockaddr_in dest;
357 int addrlen = sizeof(dest);
358 SOCKET s = accept(handle, (sockaddr *)&dest, &addrlen);
359 errcode = 0;
360 if( s==INVALID_SOCKET )
361 {
362 errcode = WSAGetLastError();
363 }
364 else
365 {
366 p = new MSocket(s);
367 p->destAddr = dest;
368 }
369 }
370 return p;
371}
372//---------------------------------------------------------------------------
373bool MTCPServer::Close(void)
374{

Callers 1

TcpAcceptFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected