简体   繁体   中英

what's the differenct amone a tcp connection, socket connection and a http connection?

It seems that many "connection" concept exist. such as socket connection, tcp connection and http connection.

so, what the difference?

它们的专业化程度不同:HTTP连接是TCP连接的一种,是套接字连接的一种。

For two entities to communicate they need a hook to each other to pass messages across - These hooks are sockets. We can say they are identities of the process. Communication b/w these sockets would be over a socket connection.

Now, how does one send messages and receive messages? Who decides to open a connection request to a socket, how does one close. Many questions arise isn't? Here comes the your TCP. By following the rules put forth by TCP, applications engage in a message exchange using TCP protocol over the sockets. Now you can refer to them as TCP connection.

Now, it need not be just stream of data bytes that the two applications exchange using the TCP protocol and b/w the two sockets. Applications can define their own protocol - Like - I am looking for a content - do you have it? - Yes, here it is I am looking for a content - do you have it? - Yes, here it is . One such applications defined protocol is HTTP. The web page of SO that you used your browser to read is over HTTP- TCP - and two sockets belonging to SO server and your browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM