mirror of
				https://github.com/eledio-devices/thirdparty-AsyncTCPSock.git
				synced 2025-10-31 08:42:38 +01:00 
			
		
		
		
	Implement write() and free() methods
Also comment out one prototype not yet implemented.
This commit is contained in:
		| @@ -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()) { | ||||
|   | ||||
| @@ -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; } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user