TCP and HTTP?
-
I never understand when to use either of these. People always talk that - "...can be transferred over TCP or HTTP...." why there is "Or" in between TCP and HTTP? i understand, HTTP internally rely on TCP for transporting. 1. When to use TCP or HTTP? 2. What extra HTTP can do which TCP does not? 3. Can anybody point me to a nice pictorial representation where the usage of TCP and HTTP depicted. (sorry for my dumb questions) Thanks.
-
I never understand when to use either of these. People always talk that - "...can be transferred over TCP or HTTP...." why there is "Or" in between TCP and HTTP? i understand, HTTP internally rely on TCP for transporting. 1. When to use TCP or HTTP? 2. What extra HTTP can do which TCP does not? 3. Can anybody point me to a nice pictorial representation where the usage of TCP and HTTP depicted. (sorry for my dumb questions) Thanks.
You can't really compare them. In a protocol stack, HTTP would be above TCP/IP assuming HTTP is using TCP/IP for its transpor protocol. HTTP is often used with TCP/IP as its transport protocol but TCP/IP isn't required. TCP/IP provides reliable transfer of a stream of bytes, and that's all. HTTP is a request/reply protocol, often implemented using TCP/IP to transfer data between clients and servers. You could probably do a little research - I bet these are two of the most documented protocols on the web... HTTP[^] TCP/IP[^]
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
You can't really compare them. In a protocol stack, HTTP would be above TCP/IP assuming HTTP is using TCP/IP for its transpor protocol. HTTP is often used with TCP/IP as its transport protocol but TCP/IP isn't required. TCP/IP provides reliable transfer of a stream of bytes, and that's all. HTTP is a request/reply protocol, often implemented using TCP/IP to transfer data between clients and servers. You could probably do a little research - I bet these are two of the most documented protocols on the web... HTTP[^] TCP/IP[^]
Mark Salsbery Microsoft MVP - Visual C++ :java:
Thanks Mark, i guess i need to do more research about TCPChannel and HTTPChannel , when to use them etc...
-
Thanks Mark, i guess i need to do more research about TCPChannel and HTTPChannel , when to use them etc...
Member 2324483 wrote:
TCPChannel and HTTPChannel
One of the main reasons to use HTTP over TCP is firewalls. Most firewalls are configured to allow HTTP on the default TCP/IP port 80 so it can generally be used without further IT intervention. TCP/IP is generally disabled so it can require a user to specifically allow TCP/IP connections on a given port. HTTP adds a bit of overhead since its a text-based protocol. Also, since it is a request/reply protocol, it's underlying TCP/IP connection may or may not be kept open, so there can be additional overhead in (re)connection time.
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Member 2324483 wrote:
TCPChannel and HTTPChannel
One of the main reasons to use HTTP over TCP is firewalls. Most firewalls are configured to allow HTTP on the default TCP/IP port 80 so it can generally be used without further IT intervention. TCP/IP is generally disabled so it can require a user to specifically allow TCP/IP connections on a given port. HTTP adds a bit of overhead since its a text-based protocol. Also, since it is a request/reply protocol, it's underlying TCP/IP connection may or may not be kept open, so there can be additional overhead in (re)connection time.
Mark Salsbery Microsoft MVP - Visual C++ :java:
Thanks Mark. Does that make sense to use HTTP within organization's network? Eg. In 3-tier mode, where database is on A, application server is hosted in IIS on B and client is on some other machine. Why would client require to open HTTPChannel to connect to application server? why not TCPChannel? I believe within organization's network firewall is not a constraint.
-
Thanks Mark. Does that make sense to use HTTP within organization's network? Eg. In 3-tier mode, where database is on A, application server is hosted in IIS on B and client is on some other machine. Why would client require to open HTTPChannel to connect to application server? why not TCPChannel? I believe within organization's network firewall is not a constraint.
Assuming you're talking WCF here... If you have no firewall or other IT issues and you have the hosting handled (self hosting or IIS 7+), you have the option to use TCP or HTTP (or both), so you can use what you want. TCP will perform better. In my experience so far, I have had no choice but to use HTTP. TCP has not been an option, even on internal corporate networks.
Mark Salsbery Microsoft MVP - Visual C++ :java: