Re: TCP question
From: Nikolay Petrov (johntup2_nospam__at_mail.bg)
Date: 01/26/05
- Next message: Cor Ligthert: "Re: Connecting a textfile to a datagrid"
- Previous message: Peter Proost: "Re: printing using vb.net"
- In reply to: Adam Goossens: "Re: TCP question"
- Next in thread: steve: "Re: TCP question"
- Reply: steve: "Re: TCP question"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 26 Jan 2005 10:53:28 +0200
I thought of way to send some kind of headers, but I am very new to
programming and I don't know how.
I wonder, because data is transferred as Bytes, should the headers be binary
or string.
the simplest thing that I can figure is to use an integer as header and
based on the integer to decide what kind of data is transmitted. Just can't
figure out how to attach the header to the sent data and how to separate it
at the receiver.
"Adam Goossens" <adamgoossens@users.sourceforge.net> wrote in message
news:uBJGJp3AFHA.2792@TK2MSFTNGP15.phx.gbl...
> 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?
>>
- Next message: Cor Ligthert: "Re: Connecting a textfile to a datagrid"
- Previous message: Peter Proost: "Re: printing using vb.net"
- In reply to: Adam Goossens: "Re: TCP question"
- Next in thread: steve: "Re: TCP question"
- Reply: steve: "Re: TCP question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|