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

Method Write

sourcecommon/udp.cpp:300–330  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

298}
299//---------------------------------------------------------------------------
300bool TUDP::Write(void * data, int size)
301{
302 WSAError = 0;
303 Error = 0;
304
305 if( !handle )
306 {
307 WSAError = MYERROR_UNKNOWNPARAMS;
308 Error = 1;
309 if( Exceptions ) throw 0;
310 return !Error;
311 }
312
313 int rv = send(handle, (char *)data, size, 0);
314 if( rv == SOCKET_ERROR )
315 {
316 WSAError = WSAGetLastError();
317 Error = 2;
318 if( Exceptions ) throw 0;
319 return !Error;
320 }
321 if( rv != size )
322 {
323 WSAError = WSAGetLastError();
324 Error = 3;
325 if( Exceptions ) throw 0;
326 return !Error;
327 }
328 OutBytes += size;
329 return ! Error;
330}
331//---------------------------------------------------------------------------
332bool TUDP::Read(void * data, int size, bool bPeek)
333{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected