I ran:
# lsof | grep 10900
And its output:
MyExecutab 103497 myuser 7u IPv4 985833 0t0 UDP my.example.com:10900
MyExecutab 103497 103498 myuser 7u IPv4 985833 0t0 UDP my.example.com:10900
MyExecutab 103497 103499 myuser 7u IPv4 985833 0t0 UDP my.example.com:10900
MyExecutab 103497 103500 myuser 7u IPv4 985833 0t0 UDP my.example.com:10900
MyExecutab 103497 103501 myuser 7u IPv4 985833 0t0 UDP my.example.com:10900
MyExecutab 103497 103502 myuser 7u IPv4 985833 0t0 UDP my.example.com:10900
MyExecutab 103497 103503 myuser 7u IPv4 985833 0t0 UDP my.example.com:10900
I am trying to figure out which thread is reading from the UDP port 10900.
It seems like there are 7 threads reading from that port, is it true?
I feel that only one thread is actually reading but lsof just listed all child threads (within the same process) and the parent thread.
netstat -plun
shows that only the parent thread (PID) is listening to that port:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 10.7.168.173:10900 0.0.0.0:* 103497/MyExecutable
I also checked /proc/[pid]/fd
. Because only 103497 is a PID, the rest are TID, so /proc/
only has 103497 but not the rest.
So is there really a way to figure out which thread listens to a specific UDP port?
I am on CentOS 7 (kernel 3.10).
Thanks!