Use strace
is more suitable for this situation.
strace -f -e trace=network -s 10000 -p <PID>;
options -f
to also trace all forked processes, -e trace=netwrok
to only filter network system-call and -s
to display string length up to 10000 char.
You can also only trace certain calls like send,recv, read operations.
strace -f -e trace=send,recv,read -s 10000 -p <PID>;