By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,199 Members | 1,742 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,199 IT Pros & Developers. It's quick & easy.

fgets not blocking

P: n/a
Say you open a socket connection with fsockopen. Normally, subsequent
calls to fgets are going to block until input is ready. Unless, of
course, socket_set_blocking is used to disable blocking (which I'm not

Unfortunately, this does not seem to always be the case. I still, on
occasion, get empty strings from fgets. Since feof returns false,
there's still input left. Yet fgets isn't giving it to me, as it
should be.

Now, I am aware that fgets stops when a new line character is
encountered, but that new line character is supposed to,
never-the-less, be included in the string that fgets returns. In my
case, it isn't. I'm just getting empty strings. And I don't see why.

Any ideas?

Aug 2 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.