add some functions to client class, and almost finished connection thread, and in_connection