Is the length field (the first 10 bytes) an integer type or character type?
If it is an integer type, you cannot run it thru the ascii/ebcdic coverted.
Integer is in binary form, you must send it as it. Please double check the
protocol....
Note: Although, I must say, 10 bytes is a strange size for an interger type.
"Versfelt, Charles" <CVERSFELT@xxxxxxxxx> wrote in message
news:mailman.31822.1299082852.2702.midrange-l@xxxxxxxxxxxx...
Eric,
Thanks for your reply. There's no End of Record, but the first ten bytes of
the reply contains the length of the rest of the reply. So I can continue
receiving until I reach the reply length. It should be no problem to code
it to do that.
First though I have to get it to send me a valid reply, which I believe
means getting through those invalid characters.
I noticed that my last message to this group, the e-mail changed the weird
characters to question marks.
The message from the server:
02/Mar/2011:09:17:15:609 -0500;4364;9;DICom.cpp;InOutProc;INFO;Server could
not send data on the socket;ERRCODE|001000011|ERRMSG|Validation of message
failed : ????????????O0000000151RATE|
Those question marks on the actual server look like foreign characters.
("O"s with accents or two dots over them.)
The characters aren't in the variable that I send in, as far as I can
tell... But the server on the other side is seeing them.
Oddly, the server isn't even sending me ERRCODE|001000011|ERRMSG| which is
what I'd expect as a reply if that was the main problem. The server is
sending me a short string of zeros, 00000000 as my entire reply.
Thanks again,
Charlie
RE: Sockets program adding characters?
Charles,
Your RecvAscii should loop over recv() until you have a complete message.
All the parts may not make it across the >network at the same time, so your
receiver must be patient.
Do you have some sort of EndOfRecord that you can watch for? Simplest
approach here is to receive one byte at a >time, append it to your "receive
buffer" while watching for your end of record character...
Hth,
-Eric DeLong=
As an Amazon Associate we earn from qualifying purchases.