-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add automatic ping on websockets #947
Conversation
a06f96d
to
562954b
Compare
Apparently older versions of std.conv.to do not support dynamic-to-static array conversion; I've now made the conversion manually to support older toolchains. |
@property const(HTTPServerSettings) serverSettings() const | ||
{ | ||
return m_settings; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave this as package
for now to avoid any potential necessity for API breakage later. If it turns out that this is useful for external libraries/applications, we can still make it public.
Signed-off-by: Luca Niccoli <[email protected]>
It will be made accessible to the websocket via HTTPServerRequest Signed-off-by: Luca Niccoli <[email protected]>
Looks good to merge, except for the public |
Makes a const reference to HTTPServerSettings accessible to HTTP delegates. Signed-off-by: Luca Niccoli <[email protected]>
Signed-off-by: Luca Niccoli <[email protected]>
I made the settings accessor |
Great, thanks! I'll merge as soon as the Travis build is ready. |
Add automatic ping on websockets
The ping interval is fixed at 60 seconds.
The best thing would probably be to set it in the server settings, thus also allowing to disable it entirely.
For this, the
WebSocket
must have access toHTTPServerSettings
; the best way would probably be to expose a const reference toHTTPServerRequest.m_settings
, which I'm going to do in the next commit of this pull request.