finished a single thread TCP server