void CPROC UDPServerRead( PCLIENT pc, POINTER buffer, uint32_t len, PSOCKADDR sa ) { if( !buffer ) { buffer = Allocate( 4096 ); } else SendUDPEx( pc, buffer, len, sa ); ReadUDP( pc, buffer, 4096 ); }
static void CPROC read_complete( PCLIENT pc, POINTER buffer, size_t size, SOCKADDR *sa ) { if( !buffer ) { buffer = Allocate( 4096 ); } else { } ReadUDP( pc, buffer, 4096 ); }
void CPROC LogRead( PCLIENT pc, POINTER buffer, size_t nSize, SOCKADDR *sa ) { tick = GetTickCount(); if( !buffer ) { buffer = Allocate( 4096 ); _tick = tick; } else { TEXTCHAR msgtime[12]; fwrite( msgtime, snprintf( msgtime, 12, WIDE("%04") _32f WIDE("|"), tick - _tick ), 1, stdout ); _tick = tick; fwrite( buffer, nSize, 1, stdout ); if( nSize < 4096 ) fwrite( WIDE("\n"), 1, 1, stdout ); fflush( stdout ); } ReadUDP( pc, buffer, 4096 ); }
void CPROC UDPClientRead( PCLIENT pc, POINTER buffer, int len, PSOCKADDR sa ) { if( !buffer ) { buffer = Allocate( 4096 ); } else { uint64_t del; SetTick( l.end ); l.accum += (del = l.end - l.start); l.passes++; l.bytes += len; if( (!l.min) || (del < l.min) ) l.min = del; if( del > l.max ) l.max = del; l.waiting = 0; } ReadUDP( pc, buffer, 4096 ); }