Skip to content

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

@don-clugston-sociomantic

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions