helics  3.6.1
UdpComms.h
1 /*
2 Copyright (c) 2017-2025,
3 Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable
4 Energy, LLC. See the top-level NOTICE for additional details. All rights reserved.
5 SPDX-License-Identifier: BSD-3-Clause
6 */
7 #pragma once
8 
9 #include "../NetworkCommsInterface.hpp"
10 #include "helics/helics-config.h"
11 
12 #include <future>
13 #include <set>
14 
15 namespace helics::udp {
17 class UdpComms final: public NetworkCommsInterface {
18  public:
20  UdpComms();
22  ~UdpComms();
23 
24  virtual void loadNetworkInfo(const NetworkBrokerData& netInfo) override;
25 
26  private:
27  virtual int getDefaultBrokerPort() const override;
28  virtual void queue_rx_function() override;
29  virtual void queue_tx_function() override;
30  virtual void closeReceiver() override;
31 
32  // promise and future for communicating port number from tx_thread to rx_thread
33  std::promise<int> promisePort;
34  std::future<int> futurePort;
35 
36  public:
37 };
38 
39 } // namespace helics::udp
Definition: NetworkBrokerData.hpp:23
Definition: NetworkCommsInterface.hpp:18
Definition: UdpComms.h:17
virtual void loadNetworkInfo(const NetworkBrokerData &netInfo) override
Definition: UdpComms.cpp:35
~UdpComms()
Definition: UdpComms.cpp:48
UdpComms()
Definition: UdpComms.cpp:24