use tcp socket to connect