Examples/KniPong/main.cpp
/**
 * Reworked fillbuf from netcat. See description in pingPongProcess
 */
Reworked fillbuf from netcat. See description in pingPongProcess
Reworked fillbuf from netcat . See description in pingPongProcess
ssize_t fillbuf(linuxFd fd, unsigned char buff[], size_t& buffPos)
{
	size_t num = IO_BUFF_SIZE - buffPos;
	ssize_t n;
	n = read(fd, buff + buffPos, num);
	if (n == -1 && (errno == EAGAIN || errno == EINTR))
		n = WANT_POLLIN;
	if (n <= 0)
		return n;
	buffPos += n;
	return n;
}
ssize_t fillbuf ( linuxFd fd , unsigned char buff [ ] , size_t & buffPos ) { size_t num = IO_BUFF_SIZE - buffPos ; ssize_t n ; n = read ( fd , buff + buffPos , num ) ; if ( n == -1 && ( errno == EAGAIN || errno == EINTR ) ) n = WANT_POLLIN ; if ( n <= 0 ) return n ; buffPos += n ; return n ; }
Reworked fillbuf from netcat.
Reworked fillbuf from netcat .