Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TidTCPClient write function - stopping at byte 0x00

90 views
Skip to first unread message

skoob mcallister

unread,
Sep 21, 2008, 1:12:07 AM9/21/08
to
I'm having some issues with a program I am writing. I need to be able
to read/write with a server that communicates through hex bytes. I
first ran into the 0x00 null terminating byte when I was reading a
command with ReadBytes. I bypassed this by using a ReadChar loop to
patch together what was sent. The same issue is happening when I use
the Write function...but I can't write byte by byte like I'm reading
it. Right now I have a simple byte array that I then send:

char _c[6];
_c[0] = 0x01;
_c[1] = 0x02;
_c[2] = 0x03;
_c[3] = 0x00;
_c[4] = 0x04;
_c[5] = 0x05;
tcpClient->IOHandler->Write(_c);

When using WireShark, I see that the only data being sent is the first
three bytes and stops at the 0x00 byte.

Is Write() the correct function to use? Could an example be posted if
there is another function I should be using to write? Any help would
be appreciated. Thanks.

0 new messages