Adding some TCP server control code