Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. TCP and HTTP?

TCP and HTTP?

Scheduled Pinned Locked Moved WCF and WF
question
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 2322509
    wrote on last edited by
    #1

    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.

    M 1 Reply Last reply
    0
    • U User 2322509

      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.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      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:

      U 1 Reply Last reply
      0
      • M Mark Salsbery

        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:

        U Offline
        U Offline
        User 2322509
        wrote on last edited by
        #3

        Thanks Mark, i guess i need to do more research about TCPChannel and HTTPChannel , when to use them etc...

        M 1 Reply Last reply
        0
        • U User 2322509

          Thanks Mark, i guess i need to do more research about TCPChannel and HTTPChannel , when to use them etc...

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          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:

          U 1 Reply Last reply
          0
          • M Mark Salsbery

            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:

            U Offline
            U Offline
            User 2322509
            wrote on last edited by
            #5

            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.

            M 1 Reply Last reply
            0
            • U User 2322509

              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.

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              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:

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups