You can use the netstat program:
netstat -b // Will give you the process involved in each connection
netstat -? // Will give you all possible options for the netstat console
From the output you will be able to get the process for each connection (process name is between brackets, easy to get with a simple regular expression).