bool rgc_size_fill_con_buffer( int bufpose, int size )
{
// we start reading at BUFPOSE - 1 because we have
// to remove the '\0' sentinel that ends the buffer
byte[] buffer = this.buffer;
int a = _socket.Available;
int nbread = _socket.Receive( buffer,
bufpose-1,
a < size ? a : size,
SocketFlags.None );
if (nbread == 0)
eof = true;
else
bufpose += nbread;
buffer[bufpose-1] = (byte)'\0';
this.bufpos = bufpose;
return (0 < bufpos);
}