Beginning of TCP server stuff.