I have a process where multiple threads open multiple socket connection. I want to view this information and map what thread has opened which socket port.
lsof -i
As MarkR suggested, you need to use strace from startup:
strace -fp
The above command will show you per thread system calls like open(), read(), recv() etc, along with the descriptors used:
[pid 428] close(36)
Once you isolated the thread, you may attach to the process and find out the exact thread with
gdb attach
Or, if you have thread names set in your process, use
ps -eL
to find out the thread's friendly name.