Article View: borland.public.cppbuilder.internet.socket
Article #39TidTCPClient write function - stopping at byte 0x00
From: skoob mcallister
Date: Sun, 21 Sep 2008 05:12
Date: Sun, 21 Sep 2008 05:12
23 lines
2111 bytes
2111 bytes
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.
Technical Details
Message-ID:
<25cd4165-82c7-45b6-9eaf-a778f8ae5f2f@k13g2000hse.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!k13g2000hse.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,9feb48b67483411a,start X-Google-Attributes: gid11508e,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!k13g2000hse.googlegroups.com!not-for-mail From: skoob mcallister <skOOb33@gmail.com> Newsgroups: borland.public.cppbuilder.internet.socket Subject: TidTCPClient write function - stopping at byte 0x00 Date: Sat, 20 Sep 2008 22:12:07 -0700 (PDT) Organization: http://groups.google.com Lines: 23 Message-ID: <25cd4165-82c7-45b6-9eaf-a778f8ae5f2f@k13g2000hse.googlegroups.com> NNTP-Posting-Host: 74.128.40.43 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1221973928 27846 127.0.0.1 (21 Sep 2008 05:12:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 21 Sep 2008 05:12:08 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k13g2000hse.googlegroups.com; posting-host=74.128.40.43; posting-account=za6VOwoAAAA9WIxUvvTD--dw_RAI0Io8 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe),gzip(gfe)