fixed some errors

In client, port was a str, but it must be a integer. In server, the
method to configure the tcpserver must be in the run method of the
thread.