Finished basic TCP server functionality