Re: TCP question

From: Adam Goossens (adamgoossens_at_users.sourceforge.net)
Date: 01/26/05


Date: Wed, 26 Jan 2005 18:09:10 +1030

Hi Nikolay,

All TCP data is transmitted as a series of bytes. It's your
responsibility to determine a proper higher-level protocol for these
bytes so you know what you're looking at.

Take the MSN protocol for example. Sometimes you receive a command that
contains binary data. The first part of the command is a Command String
(a straight Byte-To-ASCII conversion) which gives you the important
information about the command (most notably the type of command and the
length of the incoming data). You download the amount of data the
command tells you it has sent, and then judge what to do with that data
based on the command you received.

I personally would do something similar in your server and client. I
would decide on a protocol to be applied on top of TCP to designate what
sort of data you are transmitting.

Regards,
-Adam.

Nikolay Petrov wrote:
> I need to transfer different types of data from my tcp client to my tcp
> server - string, bynary, datasets.
> Ho to know what exactly data I receive?
>
>



Relevant Pages

  • Re: Suggestions for custom application-layer protocol?
    ... > the embedded device, and control messages from the monitoring terminal. ... I also want the protocol to be based on TCP/IP. ... > to be sent over a TCP socket? ... field for a command or status code, and put your data in the other fields. ...
    (comp.os.linux.embedded)
  • Re: Suggestions for custom application-layer protocol?
    ... > the embedded device, and control messages from the monitoring terminal. ... I also want the protocol to be based on TCP/IP. ... > to be sent over a TCP socket? ... field for a command or status code, and put your data in the other fields. ...
    (comp.unix.programmer)
  • Re: TCP question
    ... I wonder, because data is transferred as Bytes, should the headers be binary ... > All TCP data is transmitted as a series of bytes. ... > Take the MSN protocol for example. ... The first part of the command is a Command String (a ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Suggestions for custom application-layer protocol?
    ... I also want the protocol to be based on TCP/IP. ... >TCP socket? ... A command is one line of text. ... line identifies what kind of response it is and may ...
    (comp.os.linux.embedded)
  • Re: Serial (rs232 etc.) to IP
    ... TCP is a connection based protocol and as such it ensures that all data is ... There is no need to 'use' another protocol like Telnet if all you wish to do ... acknowledgement when the socket is first negotiated. ... >>>character packets when many common embedded TCP devices try to talk to ...
    (comp.arch.embedded)