diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index 8837073..cab5ec8 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -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()) { diff --git a/src/AsyncTCP.h b/src/AsyncTCP.h index 6ac9601..943edaa 100644 --- a/src/AsyncTCP.h +++ b/src/AsyncTCP.h @@ -87,7 +87,7 @@ class AsyncClient : public AsyncSocketBase bool connect(const char* host, uint16_t port); void close(bool now = false); - int8_t abort(); + //int8_t abort(); bool free(); bool canSend() { return space() > 0; }