Ocean
PackagedUDPClient.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef FACEBOOK_NETWORK_PACKAGED_UDP_CLIENT_H
9 #define FACEBOOK_NETWORK_PACKAGED_UDP_CLIENT_H
10 
11 #include "ocean/network/Network.h"
13 
14 namespace Ocean
15 {
16 
17 namespace Network
18 {
19 
20 /**
21  * This class implements a UDP client able to send larger messages as normally restricted by the UDP protocol.
22  * @ingroup network
23  */
24 class OCEAN_NETWORK_EXPORT PackagedUDPClient : virtual public PackagedConnectionlessClient
25 {
26  public:
27 
28  /**
29  * Creates a new UDP client.
30  */
32 
33  /**
34  * Destructs a UDP client.
35  */
36  ~PackagedUDPClient() override;
37 
38  protected:
39 
40  /**
41  * Build the UDP socket.
42  * @param localAddress The local address to which the socket will be bound, a default address to bound the socket to any local address
43  * @param localPort The local port to which the socket will be bound, a default port to bound the socket to any free port
44  * @return True, if succeeded
45  */
46  bool buildSocket(const Address4& localAddress = Address4(), const Port localPort = Port());
47 };
48 
49 }
50 
51 }
52 
53 #endif // FACEBOOK_NETWORK_PACKAGED_UDP_CLIENT_H
This class wraps an address number with 32 bits.
Definition: Address4.h:26
This class is the base class for all packaged connectionless clients.
Definition: PackagedConnectionlessClient.h:31
This class implements a UDP client able to send larger messages as normally restricted by the UDP pro...
Definition: PackagedUDPClient.h:25
bool buildSocket(const Address4 &localAddress=Address4(), const Port localPort=Port())
Build the UDP socket.
PackagedUDPClient()
Creates a new UDP client.
~PackagedUDPClient() override
Destructs a UDP client.
This class wraps a port number with 16 bits.
Definition: Port.h:26
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15