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

Connecting to non-existent / listening endpoint #18

Open
ruohki opened this issue Feb 29, 2020 · 4 comments
Open

Connecting to non-existent / listening endpoint #18

ruohki opened this issue Feb 29, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@ruohki
Copy link

ruohki commented Feb 29, 2020

As the title states,

how to deal when trying to connect to a non-answering endpoint? the connect promise will never resolve no disconnect or error gets fired?

@Gregivy
Copy link
Owner

Gregivy commented Feb 29, 2020

Hello, by default - yes. But you can use maxTimeout option (in ms)(https://gregivy.github.io/simpleddp/simpleDDP.html) like this:

let opts = {
    endpoint: "ws://someserver.com/websocket",
    SocketConstructor: ws,
    reconnectInterval: 5000,
    maxTimeout: 15000
};
const server = new simpleDDP(opts);

@aogaili
Copy link

aogaili commented Mar 13, 2020

Hello Gregivy, I'm having similar issue, I think we need a graceful way to handle that error, settings the maxTimeout doesn't throw an error.

@aogaili
Copy link

aogaili commented Mar 14, 2020

The maxtTimeout does trigger on method calls so it does the trick.

Thanks @Gregivy for this great library.

@Gregivy
Copy link
Owner

Gregivy commented Apr 8, 2020

Thank you @aliogaili, however I am going to add maxTimeout for .connect() method, it is a good idea.

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

No branches or pull requests

3 participants