Exemplo n.º 1
0
class RPCClient(object):
    """docstring for RPCClient"""
    def __init__(self, io_loop=None):
        self._io_loop = self.io_loop = io_loop or IOLoop.current()
        self._sock_fd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
        #self.sock_fd.settimeout(0.5)
        self._iostream = IOStream(self._sock_fd)
        #self.stream.set_close_callback(self.on_close)

    def check_iostream(self):
        if self._iostream is None:
            return False
        try:
            self._iostream._check_closed()
        except Exception, e:
            self._iostream = None
            return False
        else:
Exemplo n.º 2
0
class RPCClient(object):
    """docstring for RPCClient"""
    def __init__(self, io_loop=None):
        self._io_loop = self.io_loop = io_loop or IOLoop.current()
        self._sock_fd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
        #self.sock_fd.settimeout(0.5)
        self._iostream = IOStream(self._sock_fd)
        #self.stream.set_close_callback(self.on_close)

    def check_iostream(self):
        if self._iostream is None:
            return False
        try:
            self._iostream._check_closed()
        except Exception, e:
            self._iostream = None
            return False
        else: