All pastes #505472 Raw Edit

Stuff

public text v1 · immutable
·published 2007-05-23 15:49 UTC
rendered paste body
int read_socket ()
	{
		int bytes_read;
		bytes_read = recv(sockfd,rbuffer, LG_BUFFER, 0);
		
		while (rbuffer > 0) {
			if ( bytes_read > 0 ) {
		write(STDOUT_FILENO, rbuffer, bytes_read);
		fprintf(stdout,"1 message lu\n");
		fprintf(stdout,"%d octets lus\n", bytes_read);
			}
		else if (bytes_read == 0) {
			fprintf(stdout,"fin de la lecture\n");
			}
			}
			return 0;
	}