mirror of
				https://github.com/eledio-devices/thirdparty-AsyncTCPSock.git
				synced 2025-10-31 16:14:15 +01:00 
			
		
		
		
	Do not remove callbacks on socket close
Users of AsyncTCP expect callbacks installed on the object to remain active on close event and do not reinstall them if the just-closed object is reopened. Fixes failure to react to events after reopening.
This commit is contained in:
		| @@ -285,6 +285,7 @@ AsyncClient::AsyncClient(int sockfd) | ||||
| AsyncClient::~AsyncClient() | ||||
| { | ||||
|     if (_socket != -1) _close(); | ||||
|     _removeAllCallbacks(); | ||||
|     vSemaphoreDelete(_write_mutex); | ||||
|     _write_mutex = NULL; | ||||
| } | ||||
| @@ -741,7 +742,6 @@ void AsyncClient::_close(void) | ||||
|  | ||||
|     _clearWriteQueue(); | ||||
|     if (_discard_cb) _discard_cb(_discard_cb_arg, this); | ||||
|     _removeAllCallbacks(); | ||||
| } | ||||
|  | ||||
| void AsyncClient::_error(int8_t err) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user