Quote:
Originally Posted by
omega666
i just changed all of them to strlen, and the problem still occurs
You can't just blindly make the changes without making the other fixes I said too. Your code makes a lot of wrong assumptions about the behavior of sockets. It doesn't operate as expected because sockets don't either.
Quote:
how is read supposed to work, does it normally skip the \n characters?
Now you ask, after I've been trying to point it out for weeks...
read() works completely raw. It alters none of the data that passes through it. It doesn't do anything special to nulls or newlines, and nothing in the data makes it stop early. It might stop early for other reasons though, so you have to check its return value, to see if you read as many bytes as you thought you did. write() is the same. completely raw. But you have to check its return value in case it wrote less than you asked it to.