How do I add TCP/IP communication to my plugin

What is the best way to add TCP/IP communication to my plugin, including receiving asynchronous receipt of messages.