Board index » cppbuilder » TIdTCPClient write?

TIdTCPClient write?


2008-03-05 05:48:37 AM
cppbuilder92
I think I've mostly got a handle on socket reading, but now I can't
seem to get any data out over the socket.
I've tried Write() and WriteDirect() (with TByteDynArray for the
data), with WriteBufferFlush() and WriteBufferCancel() (the latter
before the write).
Packet capture shows nothing being sent.
How can it be this difficult to simply send data over a socket?
 
 

Re:TIdTCPClient write?

"Mike Ruskai" < XXXX@XXXXX.COM >wrote in message
Quote
I think I've mostly got a handle on socket reading, but now
I can't seem to get any data out over the socket.
Then you are probably not using it correctly. Please show your actual code.
Quote
I've tried Write() and WriteDirect()
Write() will work just fine. Don't call WriteDirect() directly.
Quote
(with TByteDynArray for the data)
Any particular reason why you keep using TByteDynArray instead of Indy's own
TIdBytes type?
Quote
with WriteBufferFlush() and WriteBufferCancel() (the latter before the
write).
WriteBufferFlush() does not do anything unless WriteBufferOpen() was called
first.
Quote
Packet capture shows nothing being sent.
Then you are not writing anything to begin with.
Quote
How can it be this difficult to simply send data over a socket?
Because you are using Indy the wrong way, most likely. Again, please show
your actual code.
Gambit
 

Re:TIdTCPClient write?

On or about Tue, 4 Mar 2008 14:14:04 -0800 did "Remy Lebeau \(TeamB\)"
< XXXX@XXXXX.COM >dribble thusly:
Quote

"Mike Ruskai" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>I think I've mostly got a handle on socket reading, but now
>I can't seem to get any data out over the socket.

Then you are probably not using it correctly. Please show your actual code.
It was a cerebral failure in RawToBytes(). Once I fixed that, it
writes fine.
 

{smallsort}