MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / copyFrom

Method copyFrom

Arduino/libraries/WiFi101/src/WiFiClient.cpp:68–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void 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
96int WiFiClient::connectSSL(const char* host, uint16_t port)
97{

Callers

nothing calls this directly

Calls 3

socketBufferRegisterFunction · 0.85
m2m_wifi_handle_eventsFunction · 0.85
recvFunction · 0.50

Tested by

no test coverage detected