code: def _connect_server(self):
          '''连接服务器,建立socket'''
          try:
              self._sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
              self._sock.connect((self._server_ip,self._server_port))
              #PRINT('Connect [%s:%d] success!'%(self._server_ip,self._server_port), GREEN)
          except socket.error, e:
              sys.stderr.write('ERROR: %s[%s:%d]'%(e,self._server_ip,self._server_port))
              traceback.print_exc()
              sys.exit(1f _connect_server(self):
          '''连接服务器,建立socket'''
          try:
              self._sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
              self._sock.connect((self._server_ip,self._server_port))
              #PRINT('Connect [%s:%d] success!'%(self._server_ip,self._server_port), GREEN)
          except socket.error, e:
              sys.stderr.write('ERROR: %s[%s:%d]'%(e,self._server_ip,self._server_port))
              traceback.print_exc()
              sys.exit(1)
docs: 连接服务器,建立socket