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

Method Write

sourcecommon/tcpserv.cpp:52–71  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

50}
51//---------------------------------------------------------------------------
52bool MSocket::Write(void * data, int size)
53{
54 Error = 0;
55 if( !handle ) { Error = 1; if( Exceptions ) throw 0; return ! Error; }
56
57 bytes = send(handle, (char *)data, size, 0);
58 errcode = 0;
59 if( bytes==SOCKET_ERROR ) { errcode = WSAGetLastError(); Error = 4; }
60 if( bytes<=0 ) Error = 2;
61 if( bytes<size ) Error = 3;
62 if( Error )
63 {
64 if( Exceptions ) throw 0;
65 }
66 else
67 {
68 OutBytes += size;
69 }
70 return ! Error;
71}
72//---------------------------------------------------------------------------
73bool MSocket::Read(void * data, int size)
74{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected