High Speed Network Object Packing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two computers that I want to pass objects of a couple different classes back and fourth at a high rate of speed (>60 Hz). I'm looking for a good way to do this. I've been playing with System.Net.Sockets and using XMLserialization and Binary Serialization....I was unable to figure out how to serialize the class multiple times over the same socket. I could send one instance fine, but when I tried to do it more than once (at any speed) it said there was an error in the XML file (or binary error). I'm assuming this is because XML.Serialization writes some kind of header to the stream, or it could be a timing issue.

Anyway, I'm looking for the method that people would recommend to transfer this object repeatedly. I've heard SOAP and remoting are possiblities, but I don't know much about them and I'm not sure where to look to find stuff about them and high speed communication. Thanks
Tom Kent :-)
 
For such high speed, my recommendation would be to steer clear of
webservices and remoting, and go straight to System.NET. If those 2
computers donot change with every transaction, you might consider creating a
listener on each maching, and a connection that stays open for the duration
of your communication. That'd be fast enough.

Regards serialization, BinaryFormatter serialized, send the bytes stream
over - shouldn't be a problem honestly.

- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/
 
Hi Tom,

Sorry for not getting to you sooner.

I didn't find any existing sample in the network which is fit for you exactly. Anyway, I think we can divide the problem into two parts:

1) Transfer data back and forth in Network
In order to do that, we can use socket or something else to transfer data. The following link has a sample:
http://www.codeguru.com/Csharp/Csharp/cs_network/sockets/article.php/c6039/

2) Serializa class based on the stream that we get from the network:
The following article introduces much on how to pass an object across the network.
"Object Serialization in Visual Basic .NET"
http://msdn.microsoft.com/library/en-us/dnadvnet/html/vbnet09252001.asp?frame=true

Some other useful links include:
Discussions on Serialization over NetworkStreams:
http://groups.google.com/groups?hl=...aBHA.1416@tkmsftngp02&rnum=6&prev=/groups?hl%
3Den%26lr%3D%26ie%3DUTF-8%26q%3Dserialize%2Bclass%2Bback%2Band%2Bforth%2B

"Interoperability Technologies: Point to Point"
http://msdn.microsoft.com/library/en-us/dnpag/html/jdni_ch04.asp?frame=true

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top