Char recieving problem at server side

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ahmad

    #1

    Char recieving problem at server side

    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.00int ernalSRVM 00000008DLGLGN0 00000000003TXBE G
    0000LOGIN:USER= unsadm,PSWD=TEL LIN ????

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

    00581.00interna lSRVM 00000008DLGLGN0 00000000003TXBE G
    0000LOGIN:USER= unsadm,PSWD=TEL LIN î?²?

    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


  • Marc Gravell

    #2
    Re: Char recieving problem at server side

    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.ToBase6 4String(byte[])), then reverse this
    at the other end (Convert.FromBa se64String()).

    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.Enc oding routes.

    Marc


    Comment

    Working...