Search code examples
socketscomputer-science

When 2 computer interact over a network connection then first they have to make a socket connection?


Please answers in yes or no. This will solve my doubt. 1. Is a post/get request sent from computer-1 to Computer-2 then first they have to make a socket connection? 2. When 2 computers connect with ssh then first they have to make a socket connection , then only then can talk to each other ?


Solution

  • Please answers in yes or no. This will solve my doubt. [ok]

    1. Is a post/get request sent from computer-1 to Computer-2 then first they have to make a socket connection? In this case, Yes, but if request is going from browser then it do for you.You can see thr url for get and post have the port number in them. If not mentioned the default port is 80, in general. For example If you use WebSphere Application Server, the default port is 9081 or 80 if IBM HTTP Server is configured.
    2. When 2 computers connect with ssh then first they have to make a socket connection , then only then can talk to each other ? In this Case, again Yes, the port is 22 in ssh