Skip to content
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

feat: allow custom websocket close delay #627

Merged
merged 7 commits into from Aug 27, 2022
Merged

Conversation

iProdigy
Copy link
Member

@iProdigy iProdigy commented Aug 25, 2022

Prerequisites for Code Changes

  • This pull request follows the code style of the project
  • I have tested this feature

Issues Fixed

  • Allows for faster underlying socket close for applications where this is required (e.g., minecraft plugins on disable, which triggers class unloading)

Changes Proposed

  • Add closeDelay to WebsocketConnectionConfig
  • Don't return from WebsocketConnection#close until the underlying Socket has fully closed

Additional Information

nv-websocket-client defaults closeDelay to 10_000 - this seems high to just wait for a single frame, so we default to 1000 instead (this part of the websocket protocol is just good manners anyway, so it's not the end of the world if formal close isn't received)

@iProdigy iProdigy merged commit cb5ebdb into develop Aug 27, 2022
@iProdigy iProdigy deleted the feature/ws-close-delay branch August 27, 2022 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants