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

fix: handle null server address #118

Merged
merged 1 commit into from
Jul 29, 2024
Merged

Conversation

achingbrain
Copy link
Collaborator

@achingbrain achingbrain commented Jul 24, 2024

The types for the Server.address() method in @types/ws are missing a return type of null. This can happen when a incoming connection is recieved after the ws Server has been closed but before the underlying HTTP server has finished closing down.

DefinitelyTyped/DefinitelyTyped#70132 will address the type problem, the change here is to handle the null return value.

It also calls .destroy on the incoming message since we'd want to reclaim the resources immediately and not wait for the remote to time out.

Fixes #114

The types for the `Server.address()` method in `@types/ws` are
missing a return type of `null`.  This can happen when a incoming
connection is recieved after the ws `Server` has been closed but
before the underlying HTTP server has finished closing down.

DefinitelyTyped/DefinitelyTyped#70132 will
address the type problem, the change here is to handle the `null`
return value.

It also calls `.destroy` on the incoming message since we'd want
to reclaim the resources immediately and not wait for the remote
to time out.
@achingbrain achingbrain merged commit bb8e804 into master Jul 29, 2024
16 checks passed
@achingbrain achingbrain deleted the fix/handle-null-server-address branch July 29, 2024 07:26
github-actions bot pushed a commit that referenced this pull request Jul 29, 2024
## [6.1.4](v6.1.3...v6.1.4) (2024-07-29)

### Bug Fixes

* handle null server address ([#118](#118)) ([bb8e804](bb8e804)), closes [#114](#114)
Copy link

🎉 This issue has been resolved in version 6.1.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onWsServerConnection yields null pointer exception
1 participant