is it possible to listen on the ports of your pc and monitor the information being sent to a server that another piece of software has connected too.

And is it possible write a program that can send information to an active port which is already being used by other software without making another connection to the same server?