Menu

readline() blocking

Help
Anonymous
2001-06-01
2001-06-22
  • Anonymous

    Anonymous - 2001-06-01

    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

     
    • David Sugar

      David Sugar - 2001-06-07

      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

       
    • Anonymous

      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?

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.