示例#1
0
 def __init__(self, server, sock, address):
     WebSocket.__init__(self, server, sock, address)
     self.cookie = None
     self.lock = threading.Lock()
     self.current_game = None  # should be None if not in a game
     self.id = ClientWSocket.count
     print("Client Socket Init {}".format(ClientWSocket.count))
     ClientWSocket.count += 1
    def __init__(self, server, sock, address, eventmanager):
        WebSocket.__init__(self, server, sock, address)

        self._logger = logging.getLogger(__name__)

        self.maxheader = 65536
        self.maxpayload = 4194304
        self.eventManager = eventmanager.instance

        self.eventManager.subscribe(FSEvents.ON_SOCKET_BROADCAST, self.on_socket_broadcast)
        self.eventManager.subscribe(FSEvents.ON_SOCKET_SEND, self.on_socket_send)
示例#3
0
    def __init__(self, server, sock, address, eventmanager):
        WebSocket.__init__(self, server, sock, address)

        self._logger = logging.getLogger(__name__)

        self.maxheader = 65536
        self.maxpayload = 4194304
        self.eventManager = eventmanager.instance

        self.eventManager.subscribe(FSEvents.ON_SOCKET_BROADCAST,
                                    self.on_socket_broadcast)
        self.eventManager.subscribe(FSEvents.ON_SOCKET_SEND,
                                    self.on_socket_send)
 def __init__(self):
     WebSocket.__init__(self)
     self.numeroArea = -1
 def __init__(self):
     WebSocket.__init__(self)
     self.numeroArea = -1
示例#6
0
 def sendMessage(self, data):
     WebSocket.sendMessage(self, json.dumps(data))
示例#7
0
 def __init__(self, *args):
     WebSocket.__init__(self, *args)
     self._engine = Engine()
示例#8
0
#for i in range(1000000):
#	x=get_send_data()
#	print 'x:',x
#######################################################################################
CLOSE = 0x8

listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#listen_socket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
listen_socket.bind(('127.0.0.1', 1507))
listen_socket.listen(1)

sock, addr = listen_socket.accept()
print 'connected by:', addr

client = WebSocket(0, sock, addr)
print 'Websocket created'
Listeners = [sock.fileno()]
connections = {}
connections[sock.fileno()] = client
send_time = datetime.datetime.now()
send_tick = datetime.timedelta(seconds=1)
while True:
    rList, wList, xList = select.select(Listeners, Listeners, Listeners, 7)
    if not (rList or wList or xList):
        continue

    for r in rList:
        zc = connections[r]
        zc._handleData()
        while zc.sendq:
示例#9
0
	def __init__(self, server, sock, address):
		self.subject = None
		WebSocket.__init__(self, server, sock, address)
示例#10
0
	def __init__(self, server, sock, address):
		self.role = Role.NOT_SET
		WebSocket.__init__(self, server, sock, address)
示例#11
0
 def __init__(self):
     WebSocket.__init__(self)
     Logger.__init__(self)
示例#12
0
 def __init__(self, *args, **kwargs):
     WebSocket.__init__(self, *args, **kwargs)
     _thread.start_new_thread(self.listen, ())
示例#13
0
文件: qira.py 项目: Maroc-OS/qira
 def __init__(self, server, sock, address):
     WebSocket.__init__(self, server, sock, address)
     self.qira = qiraplugin_t()
     idaapi.msg("[%s] Starting QIRA web...\n" % (self.qira.comment,))
示例#14
0
 def __init__(self, server, sock, address):
     WebSocket.__init__(self, server, sock, address)
     pass
示例#15
0
 def __init__(self):
     WebSocket.__init__(self)
     Logger.__init__(self)
 def __init__(self, server, sock, address):
     WebSocket.__init__(self, server, sock, address)
     # 联通解析开关 True:开启 False:关闭
     self.unicom = False
示例#17
0
 def __init__(self, server_, sock, address):
     WebSocket.__init__(self, server_, sock, address)
     self.connectionType = "none"