Modular and extensible TCP framework for creating client and server applications