I'm try to read data from a socket after connecting to an FTP server like this:
while((numbytes=read(sockfd, read_buffer, MAXDATASIZE-1)) > 0) {
read_buffer[numbytes] = '\0';
printf("%s",read_buffer);
}
This works, however, we never break out of the loop. The read just sites and waits for more data. I've looked at socket programming examples and all the examples just check if the bytes read are > 0. What might I be doing wrong?
Thanks,
bitwise
while((numbytes=read(sockfd, read_buffer, MAXDATASIZE-1)) > 0) {
read_buffer[numbytes] = '\0';
printf("%s",read_buffer);
}
This works, however, we never break out of the loop. The read just sites and waits for more data. I've looked at socket programming examples and all the examples just check if the bytes read are > 0. What might I be doing wrong?
Thanks,
bitwise