..
Diff: TLSSocket.cpp
- Revision:
- 1:a6995e66c9f7
- Parent:
- 0:5f745af3ec9b
--- a/TLSSocket.cpp Fri Aug 23 13:29:35 2019 +0000 +++ b/TLSSocket.cpp Thu Aug 29 06:43:11 2019 +0000 @@ -26,9 +26,21 @@ }*/ -nsapi_error_t TLSSocket::connect(const char *host, uint16_t port) +nsapi_error_t TLSSocket::connect1(const char *host, uint16_t port) { - printf("[.] Hello from TLSSocket::connect() \n"); + pc.printf("[.] Hello from TLSSocket::connect() \n"); + int ret; + + sock_addr.set_ip_address(host); + sock_addr.set_port(port); + set_hostname(host); + + return TLSSocketWrapper::connect(sock_addr); +} + +nsapi_error_t TLSSocket::connect2(const char *host, uint16_t port) +{ + pc.printf("[.] Hello from TLSSocket::connect() \n"); int ret; sock_addr.set_ip_address(host); @@ -40,18 +52,18 @@ /* Send a 'Client Hello' buffer in order to start a thread on the server */ const char* buffer = "Client Hello"; if ((ret = udp_socket.sendto(host, port, (const char*) buffer, strlen(buffer))) <= 0) - printf("Couldn't send 'Client Hello' \n"); + pc.printf("Couldn't send 'Client Hello' \n"); else - printf("sent 'Client Hello' \n"); + pc.printf("sent 'Client Hello' \n"); wait(1); final = osKernelGetTickCount(); TCPH = final - init; TTPH = TCPH/osKernelGetTickFreq(); - printf("\nTCPH: %d\n", TCPH); - printf("\nTTPH: %d\n", TTPH); - printf("\nTickFreq: %d\n", osKernelGetTickFreq()); + pc.printf("\nTCPH: %d\n", TCPH); + pc.printf("\nTTPH: %d\n", TTPH); + pc.printf("\nTickFreq: %d\n", osKernelGetTickFreq()); return TLSSocketWrapper::connect(sock_addr); -} +} \ No newline at end of file