| 66 | } |
| 67 | |
| 68 | void WiFiClient::copyFrom(const WiFiClient& other) |
| 69 | { |
| 70 | _socket = other._socket; |
| 71 | _flag = other._flag; |
| 72 | _head = other._head; |
| 73 | _tail = other._tail; |
| 74 | if (_head > _tail) { |
| 75 | memcpy(_buffer + _tail, other._buffer + _tail, (_head - _tail)); |
| 76 | } |
| 77 | |
| 78 | for (int sock = 0; sock < TCP_SOCK_MAX; sock++) { |
| 79 | if (WiFi._client[sock] == this) |
| 80 | WiFi._client[sock] = 0; |
| 81 | } |
| 82 | |
| 83 | if (_socket > -1) { |
| 84 | WiFi._client[_socket] = this; |
| 85 | |
| 86 | // Add socket buffer handler: |
| 87 | socketBufferRegister(_socket, &_flag, &_head, &_tail, (uint8 *)_buffer); |
| 88 | |
| 89 | // Enable receive buffer: |
| 90 | recv(_socket, _buffer, SOCKET_BUFFER_MTU, 0); |
| 91 | } |
| 92 | |
| 93 | m2m_wifi_handle_events(NULL); |
| 94 | } |
| 95 | |
| 96 | int WiFiClient::connectSSL(const char* host, uint16_t port) |
| 97 | { |
nothing calls this directly
no test coverage detected