def _udp_server_and_client(self, server_port, client_port, client_ip=LOCAL_IP, timeout=None): server = UDPServer(LOCAL_IP, server_port, timeout=timeout) client = UDPClient(timeout=timeout) client.set_own_ip_and_port(client_ip, client_port) client.connect_to(LOCAL_IP, server_port) self.sockets.append(server) self.sockets.append(client) return server, client