|
From: | David Sugar |
Subject: | Re: recv in TCPSession |
Date: | Sat, 02 Jun 2001 11:23:20 -0400 |
User-agent: | Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013 |
Why are you using Readline() rather than getline()? Srinivasa T.N. wrote:
David Sugar wrote:gcount() should return the number of bytes received from the last stream operation.I am using TCP fo communicating between Server and Client. In Server, I want to read line by line that is sent by Client. I am using Readline() function in Socket class. I want to check error, but I dont want to use exceptions. After Readline, gcount() alwaysreturn the length read or 0. If my client gets ^C, then at server gcount() returns me 0 (normally recv returns 0 but on other conditions -1, but gcount() always retuns +ve or 0).. Due to this, my check is failing, what should I do for that????Srinivasa T.N. wrote:Hi All,In TCPSession, we can do "*tcp >>" insted of "recv" on the socket. But, Is there way to find the length of the buffer I received with >>, because I can do something like length == -1 or length == 0...... Or, is it that I have to construct a class of my own deriving it from SocketPort and Thread...Regards, Seenu.Regards, Seenu.
[Prev in Thread] | Current Thread | [Next in Thread] |