Mistake on this page?
Report an issue in GitHub or email us
UDPSocket.h
1 
2 /** \addtogroup netsocket */
3 /** @{*/
4 /* UDPSocket
5  * Copyright (c) 2015 ARM Limited
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef UDPSOCKET_H
21 #define UDPSOCKET_H
22 
23 #include "netsocket/InternetSocket.h"
24 #include "netsocket/NetworkStack.h"
26 #include "netsocket/InternetDatagramSocket.h"
27 #include "rtos/EventFlags.h"
28 #include "ICMPSocket.h"
29 
30 
31 /** UDP socket implementation.
32  */
34 public:
35  /** Create an uninitialized socket.
36  *
37  * @note Must call open to initialize the socket on a network stack.
38  */
39  UDPSocket();
40 
41  /** Create and open a socket on the network stack of the given
42  * network interface.
43  *
44  * @tparam S Type of the Network stack.
45  * @param stack Network stack as target for socket.
46  * @deprecated since mbed-os-5.11
47  */
48  template <typename S>
49  MBED_DEPRECATED_SINCE("mbed-os-5.11",
50  "The UDPSocket(S *stack) constructor is deprecated"
51  "It discards the open() call return value."
52  "Use another constructor and call open() explicitly, instead.")
53  UDPSocket(S *stack)
54  {
55  open(stack);
56  }
57 
58 #if !defined(DOXYGEN_ONLY)
59 
60 protected:
61  virtual nsapi_protocol_t get_proto();
62 
63 #endif //!defined(DOXYGEN_ONLY)
64 
65 };
66 
67 
68 #endif
69 
70 /** @}*/
nsapi_error_t open(NetworkStack *stack)
Open a network socket on the network stack of the given network interface.
Network Interface base class.
UDPSocket()
Create an uninitialized socket.
UDP socket implementation.
Definition: UDPSocket.h:33
NetworkStack class.
#define MBED_DEPRECATED_SINCE(D, M)
MBED_DEPRECATED("message string") Mark a function declaration as deprecated, if it used then a warnin...
InternetDatagramSocket socket implementation.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.