Esempio n. 1
0
 def __init__(self, r, w, name, recvfailok, sendfailok):
     self.name = name
     self.r, self.w = r, w
     os.set_blocking(r, False)
     os.set_blocking(w, False)
     self.b = linebuffer.LineBuffer(r)
     self.pollout = select.poll()
     self.pollout.register(self.w, select.POLLOUT)
     self.recvfailok = recvfailok
     self.sendfailok = sendfailok
Esempio n. 2
0
    def __init__(self, connection):
        connection.setblocking(0)
        self.socket = connection
        self.b = linebuffer.LineBuffer(connection.fileno())
        self.out_buffer = ''
        self.pollout = select.poll()
        self.pollout.register(connection, select.POLLOUT)
        self.sendfailcount = 0
        self.failcountmsg = 1

        global nmeasocketuid
        self.uid = nmeasocketuid
        nmeasocketuid += 1
Esempio n. 3
0
    def __init__(self, connection):
        connection.setblocking(0)
        #//fcntl.fcntl(connection.fileno(), fcntl.F_SETFD, os.O_NONBLOCK)
        # somehow it's much slower to baseclass ?!?
        #super(LineBufferedNonBlockingSocket, self).__init__(connection.fileno())
        self.b = linebuffer.LineBuffer(connection.fileno())

        self.socket = connection
        self.out_buffer = ''
        self.pollout = select.poll()
        self.pollout.register(connection, select.POLLOUT)
        self.sendfail_msg = 1
        self.sendfail_cnt = 0
Esempio n. 4
0
        def __init__(self, connection, address):
            connection.setblocking(0)
            self.b = linebuffer.LineBuffer(connection.fileno())

            self.socket = connection
            self.address = address
            self.out_buffer = ''

            self.udp_port = False
            self.udp_out_buffer = ''
            self.udp_socket = False

            self.pollout = select.poll()
            self.pollout.register(connection, select.POLLOUT)
            self.sendfail_msg = 1
            self.sendfail_cnt = 0
Esempio n. 5
0
 def __init__(self, path):
     self.device = serial.Serial(*path)
     self.path = path
     self.device.timeout = 0  #nonblocking
     fcntl.ioctl(self.device.fileno(), TIOCEXCL)
     self.b = linebuffer.LineBuffer(self.device.fileno())