问题描述
- python xml-rpc老异常退出,谁能知道怎么回事啊?
-
情况是这样的,我的xml-rpc程序启动后客户端是能正常连接的,并且服务器端也能正常返回,但是等几个小时以后客户端就连接不到服务端了,客户端异常报错服务端我看见xml-server也异常退出了,谁知道怎么回事啊?def xml_rpc_server(W_step1_Queue): server = SimpleXMLRPCServer(("", 60000),requestHandler=SimpleXMLRPCRequestHandler) server.rpc_paths=('/pw_scan',) print "Listening on port 60000... ,pid:%d"%(os.getpid()) server.register_multicall_functions() server.register_function(Proc_PortScan, 'Proc_PortScan') server.serve_forever()
几个小时后客户端报错如下,
verbose=self.__verbose
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1280, in request
return self.single_request(host, handler, request_body, verbose)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1310, in single_request
response = h.getresponse(buffering=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1132, in getresponse
response.begin()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 453, in begin
version, status, reason = self._read_status()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 409, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 480, in readline
data = self._sock.recv(self._rbufsize)
socket.error: [Errno 54] Connection reset by peer
解决方案
服务器端message没有报错信息,或者哪位高手告诉我应该在哪进一步看报错?
解决方案二:
服务端如果没有信息,那是不是网络超时,中断了。这个时候你客户端重新连接一下服务器试试。