File tree Expand file tree Collapse file tree 4 files changed +13
-17
lines changed
UNITTESTS/features/netsocket/TCPSocket Expand file tree Collapse file tree 4 files changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,8 @@ TEST_F(TestTCPSocket, constructor)
62
62
63
63
TEST_F (TestTCPSocket, constructor_parameters)
64
64
{
65
- TCPSocket socketParam = TCPSocket (dynamic_cast <NetworkStack *>(&stack));
65
+ TCPSocket socketParam = TCPSocket ();
66
+ socketParam.open (dynamic_cast <NetworkStack *>(&stack));
66
67
const SocketAddress a (" 127.0.0.1" , 1024 );
67
68
EXPECT_EQ (socketParam.connect (a), NSAPI_ERROR_OK);
68
69
}
Original file line number Diff line number Diff line change @@ -42,8 +42,14 @@ class TCPSocket : public InternetSocket {
42
42
* network interface.
43
43
*
44
44
* @param stack Network stack as target for socket
45
+ *
46
+ * @deprecated since mbed-os-5.11
45
47
*/
46
48
template <typename S>
49
+ MBED_DEPRECATED_SINCE (" mbed-os-5.11" ,
50
+ " The TCPSocket(S *stack) constructor is deprecated."
51
+ " It discards the open() call return value."
52
+ " Use another constructor and call open() explicitly, instead." )
47
53
TCPSocket (S *stack)
48
54
{
49
55
open (stack);
Original file line number Diff line number Diff line change @@ -45,22 +45,6 @@ class TLSSocket : public TLSSocketWrapper {
45
45
*/
46
46
virtual ~TLSSocket ();
47
47
48
- /* * Create a socket on a network interface
49
- *
50
- * Creates and opens a socket on the network stack of the given
51
- * network interface.
52
- * If hostname is also given, user is not required to call set_hostname() later.
53
- *
54
- * @param stack Network stack as target for socket
55
- * @param hostname Hostname used for certificate verification
56
- */
57
- template <typename S>
58
- TLSSocket (S *stack, const char *hostname = NULL ) : TLSSocketWrapper(&tcp_socket, hostname)
59
- {
60
- nsapi_error_t ret = tcp_socket.open (stack);
61
- MBED_ASSERT (ret == NSAPI_ERROR_OK);
62
- }
63
-
64
48
/* * Opens a socket
65
49
*
66
50
* Creates a network socket on the network stack of the given
Original file line number Diff line number Diff line change @@ -41,8 +41,13 @@ class UDPSocket : public InternetSocket {
41
41
*
42
42
* @tparam S Type of the Network stack.
43
43
* @param stack Network stack as target for socket.
44
+ * @deprecated since mbed-os-5.11
44
45
*/
45
46
template <typename S>
47
+ MBED_DEPRECATED_SINCE (" mbed-os-5.11" ,
48
+ " The UDPSocket(S *stack) constructor is deprecated"
49
+ " It discards the open() call return value."
50
+ " Use another constructor and call open() explicitly, instead." )
46
51
UDPSocket (S *stack)
47
52
{
48
53
open (stack);
You can’t perform that action at this time.
0 commit comments