1

send() and sendto() blocking in a file transfer program

view story
linux-howto

http://stackoverflow.com – it seems that when i use send() function (in a TCP file transfer program) like this while((count = recv(socketConnection, buff, 100000, 0))>0) myfile.write(buff,count); the function recv() just waits untill the whole data comes and exits the loop when it is no more receiving any data but in a similar program for a UDP program while((n = recvfrom(sockfd,mesg,1024,0,(struct sockaddr *)&cliaddr,&len))>0) myfile.write(mesg,n); the recvfrom() function just blocks and does not exit the loop for some reason, as far as i know both recv() and recvfrom() are blocking right?? Then wh (HowTos)