What is the difference between a port and a socket?

后端 未结 30 1947
旧巷少年郎
旧巷少年郎 2020-11-22 14:31

This was a question raised by one of the software engineers in my organisation. I\'m interested in the broadest definition.

30条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 15:17

    A socket is basically an endpoint for network communication, consisting of at least an IP-address and a port. In Java/C# a socket is a higher level implementation of one side of a two-way connection.

    Also, a definition in the Java documentation.

提交回复
热议问题