All pastes #506027 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-05-23 20:23 UTC
rendered paste body
int read_socket ()
	{
		
		int i,t,z;
		z = 0;
		
		while (z != -1) {
		
			z = recv(sockfd, rbuffer, LG_BUFFER, MSG_PEEK);
			t=strlen(rbuffer);
			for (i=0; (i+1) < t && rbuffer[i] != '\r' && rbuffer[i+1] != '\n'; i++) {
			fprintf(stdout, "%c", rbuffer[i]);
			}
		}
	    	return 0;
		
	}