Reputation: 11
I'm working on a simple network project, and would like to transfer objects directly using a TCPListener / Client connection. I would like to avoid the WCF overhead, and just have a simple way of serializing the object on the way out, sending it over the network, and finally restoring it back to the original on the other end.
Thanks
Upvotes: 1
Views: 2839
Reputation: 9575
Well if you need ONLY serialization/deserialization behavior without involving WCF or Remoting, there is a plenty ways:
All approaches have strong and weak sides, but I believe that for your needs #1 will be enough. Reasonable compact and without external libraries need.
Upvotes: 0
Reputation: 16500
Remoting is out of favor now that there is WCF. WCF is highly optimized for performance and will win over remoting in most cases. See http://msdn.microsoft.com/en-us/library/bb310550.aspx. You don't mention whether you are worried about runtime overhead or the overhead of learning how to use WCF. That being said, you can reduce the runtime overhead by using the binary TCP transport instead of the HTTP one. It works well, though HTTP (SOAP) is, of course, highly popular now. Your service can support multiple transports (i.e., TCP and HTTP) to work well with .NET clients (TCP transport) and other standards-compliant clients (HTTP SOAP transport).
Upvotes: 2
Reputation: 8269
Look into .NET Remoting; it makes things easy!
And it's a big topic to display a sample in a comment here =)
Read here: http://msdn.microsoft.com/en-us/library/kwdt6w2k(VS.71).aspx
Upvotes: 1