I'm new to .NET Remoting and not very familiar with the different communication channels which can be used. I know there is HttpChannel and TcpChannel out of the box. I understand that one is Http while the other is Tcp, but I don't understand why Tcp is faster.
-
Please check this http://stackoverflow.com/questions/1196623/tcp-vs-http-benchmark – Arnkrishn Jan 22 '10 at 16:40
-
Note that the .NET Remoting technology has been deprecated in favor of WCF. You should not be using Remoting for new development. – John Saunders Jan 22 '10 at 16:43
-
In the processing of learning WCF, I wanted to learn .NET remoting to understand the roots and seeing what drawbacks WCF addressed. Thanks for pointing that out though! – Jan 22 '10 at 16:52
-
This post [http://stackoverflow.com/questions/1196623/tcp-vs-http-benchmark](http://stackoverflow.com/questions/1196623/tcp-vs-http-benchmark) should be handy. cheers – Arnkrishn Jan 22 '10 at 16:43
4 Answers
The HTTP channel has to create a huge (relatively speaking) header and parse complex responses. The TCP channel on the uses an efficient binary protocol with much less overhead per request.

- 58,259
- 26
- 121
- 165
TCP is slightly faster than HTTP; HTTP defaults to using the slower Soap formatter and TCP defaults to using the faster Binary formatter; HTTP supports the faster Binary formatter - you just need to select it

- 57,174
- 8
- 131
- 162
The reason Tcp is faster, is that it uses binary as a means of data transmission across the wire, with TcpChannel, you can use any port number above 1024 (the first 1024 ports are reserved). Whereas with HttpChannel, it is using port 80, the standard port that is shared with your web browser, the HttpChannel is used if you want to make it flexible with other services. Furthermore, data passed through the HttpChannel are encoded in text, which makes it slower, for an example, if you were to retrieve an image, that image would have to be encoded first into Base64 data format and transferred across.
Generally, if you want speed, go for TcpChannel, if you want flexibility, go for HttpChannel.
Hope this helps, Best regards, Tom.

- 34,087
- 8
- 78
- 110
-
do you know if Remoting is supposed to be able to support more than one HttpChannel? – Dave Feb 23 '11 at 00:51
Tcp is faster because it is a faster protocol.
Tcp is a lower level protocol that can establish a secure reliable connection. Http is easier to use as you can send it to a web server from your browser.

- 3,494
- 3
- 23
- 23