mirror of
				https://github.com/eledio-devices/thirdparty-AsyncTCPSock.git
				synced 2025-10-31 08:42:38 +01:00 
			
		
		
		
	Add abort() support if enabled in LWIP
This commit is contained in:
		| @@ -802,6 +802,19 @@ void AsyncClient::close(bool now) | ||||
|     if (_socket != -1) _close(); | ||||
| } | ||||
|  | ||||
| int8_t AsyncClient::abort(){ | ||||
|     if (_socket != -1) { | ||||
|         // Note: needs LWIP_SO_LINGER to be enabled in order to work, otherwise | ||||
|         // this call is equivalent to close(). | ||||
|         struct linger l; | ||||
|         l.l_onoff = 1; | ||||
|         l.l_linger = 0; | ||||
|         setsockopt(_socket, SOL_SOCKET, SO_LINGER, &l, sizeof(l)); | ||||
|         _close(); | ||||
|     } | ||||
|     return ERR_ABRT; | ||||
| } | ||||
|  | ||||
| const char * AsyncClient::errorToString(int8_t error){ | ||||
|     switch(error){ | ||||
|         case ERR_OK: return "OK"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user