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

Websocket connection prevents node.js process from exiting #1850

Closed
vanruch opened this issue Aug 7, 2018 · 10 comments
Closed

Websocket connection prevents node.js process from exiting #1850

vanruch opened this issue Aug 7, 2018 · 10 comments
Assignees
Labels
Bug Addressing a bug Enhancement Includes improvements or optimizations

Comments

@vanruch
Copy link

vanruch commented Aug 7, 2018

After calling new Web3('ws://localhost:8545') the node.js process never ends but instead hangs forever
Calling web3.currentProvider.connection.close() does not help and throws error when using with the HttpProvider.
(Of course you can call process.exit(0) but it's ugly)

@levino
Copy link
Contributor

levino commented Aug 8, 2018

Agreed. I suggest a method like:

web3.currentProvider.disconnect which just does nothing for the HTTPProvider.

@nivida nivida self-assigned this Aug 10, 2018
@nivida nivida added Bug Addressing a bug Enhancement Includes improvements or optimizations labels Aug 10, 2018
@sawyna
Copy link
Contributor

sawyna commented Aug 13, 2018

Hi, I would like to start working on this issue. I'll assign it myself and submit a PR. Please suggest if that's not the process.

@nivida
Copy link
Contributor

nivida commented Aug 13, 2018

You can't assign it to your self but feel free to submit a PR and reference this issues there. @sawyna

@sawyna
Copy link
Contributor

sawyna commented Aug 14, 2018

@nivida I see the WebSocketProvider no longer exists on develop branch. . I could find it in the last beta though

https://github.com/ethereum/web3.js/tree/v1.0.0-beta.34/packages/web3-providers-ws

Also it was supported through Web3.providers.WebSocketProvider. It's no longer the case.
I tried looking at the code base to see if this got moved elsewhere with no luck. Can you shed some light on what happened?

@nivida
Copy link
Contributor

nivida commented Aug 14, 2018

@sawyna the develop branch is v20.x.x of Web3 and v1.0.0-beta.xx is in the 1.0 branch :)

@sawyna
Copy link
Contributor

sawyna commented Aug 14, 2018

So this issue relates to 1.0 branch then.

@sawyna
Copy link
Contributor

sawyna commented Aug 15, 2018

PR: #1881

@yxliang01
Copy link
Contributor

There is no disconnect for ipc provider in https://github.com/ethereum/web3.js/pull/1881/files though. We would need one - a TODO.

yxliang01 added a commit to yxliang01/web3.js that referenced this issue Oct 17, 2018
This makes the interface of `IpcProvider` more conform with other providers. This follows up on web3#1881 . This partially resolves web3#1850 .
@yxliang01
Copy link
Contributor

Okay never mind. I have just done it - not a TODO anymore.

@sawyna
Copy link
Contributor

sawyna commented Oct 18, 2018

Oh yes! I missed it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug Enhancement Includes improvements or optimizations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants