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

Socket Connection Close on timeout #17

Closed
usman-invozone opened this issue Jul 4, 2023 · 4 comments
Closed

Socket Connection Close on timeout #17

usman-invozone opened this issue Jul 4, 2023 · 4 comments

Comments

@usman-invozone
Copy link

usman-invozone commented Jul 4, 2023

hi, when there is error like invalid url or port and timeout occurs, my terminal keeps engaged because of socket listener, you should use this.socket.close(); in SetTimeout function I think, can you please check and fix

const timer = setTimeout(() => { const error = new Error( "NTP request timed out, server didn't answered" ); this.socket.close(); return reject(error); }, timeout);

@luk3skyw4lker
Copy link
Owner

luk3skyw4lker commented Jul 5, 2023

Could you make a PR with the fix so I can review the code and make a release? If you can't I'll let you know when I will fix it.

@luk3skyw4lker
Copy link
Owner

In another note, if you're using the server, it is supposed to be hanging. A server should always listen requests, if one of them throws an error the server should return the error without breaking down.

@thiagotognoli
Copy link
Contributor

@luk3skyw4lker Hi i open a PR to thyis bugfix, and add typescript typing too

@luk3skyw4lker
Copy link
Owner

Solved by #21

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

No branches or pull requests

3 participants