TCP/IP sockets have no concept of "users" or "ownership": There are 65535 available ports on a given network interface, and there can only be one process listening at any given one. What user owns the process is irrelevant - if you have User1's process listening on 127.0.0.1:40000, then User2's process' attempt to listen on the same port will fail.
Likewise, there is no intrinsic access control: if there's a listening port at a given port, anything that can reach the computer at that port can access the port (in other words, the listening and connecting processes - server and client - don't need to belong to the same user; they might even be on different hosts).
发布评论
评论(1)
我会让你失望的,是前者。
TCP/IP 套接字没有“用户”或“所有权”的概念:给定的网络接口上有 65535 个可用端口,并且只能有一个进程在侦听任何给定的端口。哪个用户拥有该进程是无关紧要的 - 如果您让 User1 的进程侦听 127.0.0.1:40000,则 User2 的进程尝试侦听同一端口将会失败。
同样,没有内在的访问控制:如果给定端口有侦听端口,则任何可以到达该端口的计算机的东西都可以访问该端口(换句话说,侦听和连接进程 - 服务器和客户端 - 不能访问该端口)需要属于同一用户;它们甚至可能位于不同的主机上)。
I will disappoint you, it's the former.
TCP/IP sockets have no concept of "users" or "ownership": There are 65535 available ports on a given network interface, and there can only be one process listening at any given one. What user owns the process is irrelevant - if you have User1's process listening on 127.0.0.1:40000, then User2's process' attempt to listen on the same port will fail.
Likewise, there is no intrinsic access control: if there's a listening port at a given port, anything that can reach the computer at that port can access the port (in other words, the listening and connecting processes - server and client - don't need to belong to the same user; they might even be on different hosts).