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 Jan 15, 2015
1 parent 88941f5 commit f241c4d
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 @@ -208,8 +208,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 f241c4d

Please sign in to comment.