@@ -56,14 +56,12 @@ Socket::~Socket() {
56
56
/* *
57
57
* @brief Accept a new socket.
58
58
*/
59
- Socket Socket::accept (bool useSSL ) {
59
+ Socket Socket::accept () {
60
60
struct sockaddr addr;
61
61
getBind (&addr);
62
- ESP_LOGD (LOG_TAG, " >> accept: Accepting on %s; sockFd: %d, using SSL: %d" , addressToString (&addr).c_str (), m_sock, useSSL );
62
+ ESP_LOGD (LOG_TAG, " >> accept: Accepting on %s; sockFd: %d, using SSL: %d" , addressToString (&addr).c_str (), m_sock, getSSL () );
63
63
64
- struct sockaddr_in clientAddress;
65
- socklen_t clientAddressLength = sizeof (clientAddress);
66
- int clientSockFD = ::lwip_accept_r (m_sock, (struct sockaddr *)&clientAddress, &clientAddressLength);
64
+ int clientSockFD = ::lwip_accept_r (m_sock, nullptr , nullptr );
67
65
if (clientSockFD == -1 ) {
68
66
SocketException se (errno);
69
67
ESP_LOGE (LOG_TAG, " accept(): %s, m_sock=%d" , strerror (errno), m_sock);
@@ -73,7 +71,7 @@ Socket Socket::accept(bool useSSL) {
73
71
ESP_LOGD (LOG_TAG, " - accept: Received new client!: sockFd: %d" , clientSockFD);
74
72
Socket newSocket;
75
73
newSocket.m_sock = clientSockFD;
76
- if (useSSL ) {
74
+ if (getSSL () ) {
77
75
newSocket.setSSL (true );
78
76
newSocket.m_sslSock .fd = clientSockFD;
79
77
newSocket.sslHandshake ();
@@ -252,7 +250,7 @@ bool Socket::isValid() {
252
250
/* *
253
251
* @brief Create a listening socket.
254
252
* @param [in] port The port number to listen upon.
255
- * @param [in] isDatagram True if we are listening on a datagram.
253
+ * @param [in] isDatagram True if we are listening on a datagram. The default is false.
256
254
*/
257
255
void Socket::listen (uint16_t port, bool isDatagram) {
258
256
ESP_LOGD (LOG_TAG, " >> listen: port: %d, isDatagram: %d" , port, isDatagram);
0 commit comments