[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: tcpstream write() weirdness
From: |
Klaus Triendl |
Subject: |
RE: tcpstream write() weirdness |
Date: |
Fri, 22 Nov 2002 09:03:39 +0100 |
i had the same problem; i derived my own class from tcpstream with an
overloaded write() - writing worked as long as i didn't read.
try to clear() the stream before you write - this worked for me.
--
triendl klaus
-----Original Message-----
From: address@hidden [mailto:address@hidden
Behalf Of Ari Johnson
Sent: Friday, November 22, 2002 7:10 AM
To: David Sugar
Cc: address@hidden
Subject: Re: tcpstream write() weirdness
I forgot the mention that in the first message: I do a flush after the
write. Like I said, the first thing I write (which contains a newline but
does not end with a newline) does get sent in its entirety, but the second
does not.
Ari Johnson
--
On Fri, 22 Nov 2002, David Sugar wrote:
>
> The stream classes require implicit flushes because you are writing to the
> internal stream buffer first, and then real writes occur. This can be
> done with << endl or by implicity calling flush().
>
> On Thu, 21 Nov 2002, Ari Johnson wrote:
>
> >
> > I'm using tcpstream (for simplicity) in a multithreaded app, and am
> > protecting all read() and write() calls on it with a mutex. I am able
to
> > write to the tcpstream once and read the server's response, but the next
> > write() call simply never gets sent out to the network. Is this a known
> > issue? Many times I've banged my head off of walls trying to figure out
> > why something won't work for me, only to have a mailing list inform me
> > that I was doing something that I shouldn't, so I wonder if that's not
the
> > case here. Below, find a basic idea of what my class hierarchy looks
> > like; and thank you to any who reply.
> >
> > Ari Johnson
> >