Skip to content

Commit

Permalink
[Telink] Redefined ping timeout for WebSocketServer
Browse files Browse the repository at this point in the history
As Test_TC_OO_2_3 has been failing on Telink platform because of WS closing on server side,
added redefinition of secs_since_valid_ping and secs_since_valid_hangup so the connection would not be closed during the test.

Signed-off-by: Dmytro Huz  <dmytro.huz@telink-semi.com>
  • Loading branch information
interfer committed Nov 17, 2023
1 parent 523c19f commit 16a1587
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions examples/common/websocket-server/WebSocketServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,15 @@ CHIP_ERROR WebSocketServer::Run(chip::Optional<uint16_t> port, WebSocketServerDe

lws_context_creation_info info;
memset(&info, 0, sizeof(info));
info.port = port.ValueOr(kDefaultWebSocketServerPort);
info.iface = nullptr;
info.pt_serv_buf_size = kMaxMessageBufferLen;
info.protocols = protocols;
info.port = port.ValueOr(kDefaultWebSocketServerPort);
info.iface = nullptr;
info.pt_serv_buf_size = kMaxMessageBufferLen;
info.protocols = protocols;
static const lws_retry_bo_t retry = {
.secs_since_valid_ping = 400,
.secs_since_valid_hangup = 400,
};
info.retry_and_idle_policy = &retry;

auto context = lws_create_context(&info);
VerifyOrReturnError(nullptr != context, CHIP_ERROR_INTERNAL);
Expand Down

0 comments on commit 16a1587

Please sign in to comment.