nmea.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:pypilot 作者: pypilot 项目源码 文件源码
def new_socket_connection(self, server):
        connection, address = server.accept()
        max_connections = 10
        if len(self.sockets) == max_connections:
            connection.close()
            print 'nmea server has too many connections'
            return

        if not self.sockets:
            self.setup_watches()
            self.pipe.send('sockets')

        sock = NMEASocket(connection)
        self.sockets.append(sock)
        #print 'new connection: ', address
        self.addresses[sock] = address
        fd = sock.socket.fileno()
        self.fd_to_socket[fd] = sock

        self.poller.register(sock.socket, select.POLLIN)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号