My Dtrace book covers this topic. Many solaris tools, including snoop, dtrace and lots of network statistics
the linux "ss" command -- http://www.binarytides.com/linux-ss-command/. can track down pid, among other things
http://www.javaspecialists.eu/archive/Issue169.html is a solution in the java world