Add basic networking code and testing code in main