多个进程正在侦听同一个端口。但据我所知,只有一个进程可以监听一个端口。是否有可能(如何?)多个进程可以在同一个端口上侦听?
$ sudo lsof -n -i :80 | grep LISTEN
haproxy 2039 root 4u IPv4 12874 0t0 TCP *:http (LISTEN)
haproxy 2042 root 4u IPv4 12898 0t0 TCP *:http (LISTEN)
haproxy 2045 root 4u IPv4 12923 0t0 TCP *:http (LISTEN)
Run Code Online (Sandbox Code Playgroud)
pstree 输出:
init
??acpid -c /etc/acpi/events -s /var/run/acpid.socket
??atd
??cron
??dbus-daemon --system --fork
??dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
??docker -d
? ??6*[{docker}]
??getty -8 38400 tty4
??getty -8 38400 tty5
??getty -8 38400 tty2
??getty -8 38400 …Run Code Online (Sandbox Code Playgroud)