Implement write() and free() methods

Also comment out one prototype not yet implemented.
This commit is contained in:
Alex Villacís Lasso
2020-12-21 13:48:24 -05:00
parent 7a70bda9ce
commit de2a0da915
2 changed files with 13 additions and 1 deletions

View File

@@ -777,6 +777,18 @@ void AsyncClient::_clearWriteQueue(void)
}
}
bool AsyncClient::free(){
if (_socket == -1) return true;
return (_conn_state == 0 || _conn_state > 4);
}
size_t AsyncClient::write(const char* data) {
if(data == NULL) {
return 0;
}
return write(data, strlen(data));
}
size_t AsyncClient::write(const char* data, size_t size, uint8_t apiflags) {
size_t will_send = add(data, size, apiflags);
if(!will_send || !send()) {