Merge pull request #752 from bryghtlabs-richard/feat/websocketReconnectOnClose

feat(websocket): add ability to reconnect after close (IDFGH-15455)
This commit is contained in:
Euripedes
2025-06-27 14:31:16 +02:00
committed by GitHub
2 changed files with 21 additions and 6 deletions

View File

@ -48,7 +48,8 @@ typedef enum {
WEBSOCKET_ERROR_TYPE_NONE = 0,
WEBSOCKET_ERROR_TYPE_TCP_TRANSPORT,
WEBSOCKET_ERROR_TYPE_PONG_TIMEOUT,
WEBSOCKET_ERROR_TYPE_HANDSHAKE
WEBSOCKET_ERROR_TYPE_HANDSHAKE,
WEBSOCKET_ERROR_TYPE_SERVER_CLOSE
} esp_websocket_error_type_t;
/**
@ -101,6 +102,7 @@ typedef struct {
const char *password; /*!< Using for Http authentication */
const char *path; /*!< HTTP Path, if not set, default is `/` */
bool disable_auto_reconnect; /*!< Disable the automatic reconnect function when disconnected */
bool enable_close_reconnect; /*!< Enable reconnect after server close */
void *user_context; /*!< HTTP user data context */
int task_prio; /*!< Websocket task priority */
const char *task_name; /*!< Websocket task name */