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

Timeout issue #15

Closed
FadyQJ opened this issue Nov 3, 2019 · 2 comments
Closed

Timeout issue #15

FadyQJ opened this issue Nov 3, 2019 · 2 comments

Comments

@FadyQJ
Copy link

FadyQJ commented Nov 3, 2019

I noticed when an action takes some time I get an error:

WebSocket connection to 'ws://localhost:3000/sockjs-node/324/1puq2ekr/websocket' failed:
WebSocket is closed before the connection is established.

I receive the data no problem but I am getting this warning.

An example code I am using is the following:

console.log("Start");
emit('sourceGet', params).then(res => {
  console.log("End");
  setState({
    mode: 0,
    ...res
  });
});

The console output is
Start
The error mentionned
End

in SourceGet if I remove the function that takes time, the error dissapears.
The function is a nodejs addon (c++ based) so it should not intervene with eiphop.

And thanks for such a great api

@shivekkhurana
Copy link
Member

Hi @FadyQJ

Electron's IPC (the library Eiphop depends) on has no concept of timeout. Eiphop keeps track of your emits and resolves when the main process returns a result. It never times out.

My guess is that the warning is thrown by some part of sourceGet and not Eiphop. However, I'll be happy to investigate if you can setup a sample repo.

Thanks

@FadyQJ
Copy link
Author

FadyQJ commented Nov 6, 2019

Thanks @shivekkhurana
This is the second time I report an issue where the problem is from my end :D
The code is probably my node addon because when I remove it the error goes away.
I'll investigate the issue and if anything comes up regarding Eiphop I'll report back.

@FadyQJ FadyQJ closed this as completed Nov 6, 2019
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

2 participants