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

The example in DhtClient.d doesn't work with Neo (events still registered with epoll) #216

Open
don-clugston-sociomantic opened this issue Sep 3, 2019 · 1 comment

Comments

@don-clugston-sociomantic
Copy link
Contributor

The example in src/dhtproto/client/DhtClient.d is essentially

        // Initialise dht client -- Step 2
        auto dht = new DhtClient(epoll, NumConnections);

        // Add nodes -- Step 3
        ...
        // Perform node handshake -- Step 4
        dht.nodeHandshake(&handshake, &notify);
        epoll.eventLoop();

        // Perform a Get request -- Step 5
        dht.assign(dht.get("my_channel", key, &receive_value, &notify));

However, step 5 will never be reached. The reason is that nodeHandshake() leaves events registered with epoll (they are all of the form 10: ConnectProtocol fd=177 events=ReRh, I think they are listening for read events on each node?)
So eventLoop() never returns.

@don-clugston-sociomantic
Copy link
Contributor Author

The example in dhtproto/src/dhtproto/client/UsageExamples.d instead calls dht.blocking.waitAllHashRangesKnown() which can only be run from inside a Task and is therefore conceptually completely different.
Both DmqNeo and DlsNeo are usable without Tasks. If DhtNeo requires Tasks, that should be stated somewhere.

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

1 participant