示例#1
0
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 );
}
示例#2
0
文件: app_test.c 项目: d3x0r/SACK
static void CPROC read_complete( PCLIENT pc, POINTER buffer, size_t size, SOCKADDR *sa )
{
	if( !buffer )
	{
      buffer = Allocate( 4096 );
	}
	else
	{
	}
   ReadUDP( pc, buffer, 4096 );
}
示例#3
0
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 );
}
示例#4
0
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 );
}