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

Method Read

sourcecommon/tcpserv.cpp:73–92  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

71}
72//---------------------------------------------------------------------------
73bool MSocket::Read(void * data, int size)
74{
75 Error = 0;
76 if( !handle ) { Error = 1; if( Exceptions ) throw 0; return ! Error; }
77
78 bytes = recv(handle, (char *)data, size, 0);
79 errcode = 0;
80 if( bytes==SOCKET_ERROR ) { errcode = WSAGetLastError(); Error = 4; }
81 if( bytes<=0 ) Error = 2;
82 if( bytes<size ) Error = 3;
83 if( Error )
84 {
85 if( Exceptions ) throw 0;
86 }
87 else
88 {
89 InBytes += bytes;
90 }
91 return ! Error;
92}
93//---------------------------------------------------------------------------
94DWORD MSocket::ReadLength(void)
95{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected