Sending a structure by tcp?

  • Thread starter Thread starter jamie
  • Start date Start date
J

jamie

Is there a way of sending a structure, or a class over
tcpip? The current way I am trying to do it is by using a
binary writer and sending the individual variables one by
one.

I know there is object serialization, but that sends all
the extra information that I dont need. I just want to
send the actual variables over the network, and no extra
class information.

Anybody know a better way to send a stucture?
 
When you say class or structure, do you mean the Class declaration or an
object, you may want to consider SOAP, Simple Object Access Protocol.

http://www.w3schools.com/soap/soap_intro.asp

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing
 
Jamie,
Using a Binary Writer as you are is the simplest form of Serialization that
is available in .NET.

Unless you need Serialization or Remoting (which uses Serialization) I would
recommend you continue using the Binary Writer...

It sounds like you already have an implementation, however the following
article offers using a BinaryReader & BinaryWriter to serializing a class to
a NetworkStream. I suspect you are doing the same thing.

http://msdn.microsoft.com/library/default.asp?url=/library/en-s/dncscol/html/csharp09182003.asp

The example is in C#, however it should be easily converted to VB.NET, post
if you need help.

Hope this helps
Jay
 
Back
Top