separate socket and client into two different threads