Skip to content

Commit

Permalink
Read websocket ping interval from server settings
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Niccoli <l.niccoli@awtech.it>
  • Loading branch information
lniccoli committed Dec 31, 2014
1 parent d9c3bb5 commit 49b1add
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/vibe/http/websockets.d
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ final class WebSocket {
m_writeMutex = new TaskMutex;
m_readMutex = new TaskMutex;
m_readCondition = new TaskCondition(m_readMutex);
m_pingTimer = setTimer(dur!"seconds"(60), &sendPing, true);
m_pongReceived = true;
if (request !is null && request.serverSettings.webSocketPingInterval != Duration.zero) {
m_pingTimer = setTimer(request.serverSettings.webSocketPingInterval, &sendPing, true);
m_pongReceived = true;
}
}

/**
Expand Down

0 comments on commit 49b1add

Please sign in to comment.