How do you prevent a ReadLine() to not block if a server forgot to send a carriage return and doesnt close the connection.
The readline() method keep calling recv() until the buffer is full or \r or \n is found. If a server sent a short message without carriage return and doesnt close the connection the call block on recv().
shall we call ispending() everytime recv() is call in the ReadLine() ?
marco
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We can to some degree argue the server is broken, but yes, I think you are right that a timeout paramater is needed for Readline and that isPending should be used in from of the recv.
David
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2001-06-22
I am attempting to use cc++ for a jabber client. Jabber sends a constant xml stream and does not send a \r or \n.
So the server is not "broken"
Wondering if there is a suggested work around?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How do you prevent a ReadLine() to not block if a server forgot to send a carriage return and doesnt close the connection.
The readline() method keep calling recv() until the buffer is full or \r or \n is found. If a server sent a short message without carriage return and doesnt close the connection the call block on recv().
shall we call ispending() everytime recv() is call in the ReadLine() ?
marco
We can to some degree argue the server is broken, but yes, I think you are right that a timeout paramater is needed for Readline and that isPending should be used in from of the recv.
David
I am attempting to use cc++ for a jabber client. Jabber sends a constant xml stream and does not send a \r or \n.
So the server is not "broken"
Wondering if there is a suggested work around?