Char recieving problem at server side

  • Thread starter Thread starter Ahmad
  • Start date Start date
A

Ahmad

Hi,

I have developed a Client application in C#. I am sending some message in
the form of string to a server application. At the end of the message a 4
byte Checksum is appended.

Now the problem is that when I send message to server after calculating and
appending the checksum at the end of the message, checksum is not properly
received at server side. Checksum is replaced by ????. See received message
at server side below.

00581.00internalSRVM 00000008DLGLGN000000000003TXBEG
0000LOGIN:USER=unsadm,PSWD=TELLIN ????

where as the message sent to the server was as follows.

00581.00internalSRVM 00000008DLGLGN000000000003TXBEG
0000LOGIN:USER=unsadm,PSWD=TELLIN î?²?

Hex value of Checksum on client side is as follow:

EE 3F B2 3F

but when received on server side its value becomes
3F 3F 3F 3F (means ????)

Kindly let me know about the solution as I am in too much hurry.

Thanks in advance.

With best wishes

Ahmad Jalil
 
as I am in too much hurry.
nice ;-p

Anyways... you need to decide whether you are sending strings or bytes. If
you are sending strings, then you should be able to encode the checksum
bytes (base 64 perhaps - Convert.ToBase64String(byte[])), then reverse this
at the other end (Convert.FromBase64String()).

If you are transferring bytes, then you need to do the opposite, and encode
the string e.g. to Utf8 bytes via any of the System.Text.Encoding routes.

Marc
 
Back
Top