def accepting_allow_wait_forever(self): self._mm_should_run = True while self._mm_should_run: input_ready,output_ready,except_ready = select.select([self._mm_server_socket],[],[],self._mm_time_server_refresh) if input_ready == []: continue data,address = netutil.packet_recv_udp(self._mm_server_socket,self._mm_max_packet_size) if address not in self._mm_connections: connection = MastermindConnectionThreadUDP(self, address) connection.thread = threading.Thread(target=connection.run_forever) connection.thread.start() while not connection.handling: pass self._mm_connections[address] = connection self.callback_client_receive(self._mm_connections[address]) self._mm_connections[address].handle(data)
def accepting_allow_wait_forever(self): self._mm_should_run = True while self._mm_should_run: input_ready,output_ready,except_ready = select.select([self._mm_server_socket],[],[],self._mm_time_server_refresh) if input_ready == []: continue try: data,address = netutil.packet_recv_udp(self._mm_server_socket,self._mm_max_packet_size) if address not in self._mm_connections: connection = MastermindConnectionThreadUDP(self, address) connection.thread = threading.Thread(target=connection.run_forever) connection.thread.start() while not connection.handling: pass self._mm_connections[address] = connection self.callback_client_receive(self._mm_connections[address]) self._mm_connections[address].handle(data) except ConnectionResetError: pass
def _mm_receive_func(self): data, address = netutil.packet_recv_udp(self._mm_socket, self._mm_max_packet_size) return data, True
def _mm_receive_func(self): data,address = netutil.packet_recv_udp(self._mm_socket,self._mm_max_packet_size) return data,True