sociomantic-tsunami / dlsproto

Distributed Log Store protocol definition, client, fake node, and tests
Boost Software License 1.0
3 stars 18 forks source link

Fix documentation for dlstest.DlsClient #33

Closed daniel-zullo closed 6 years ago

daniel-zullo commented 6 years ago

The documentation in the examples/tests for the method connectionNotifier() in module dlstest.DlsClient is incorrect for the tag neo-alpha-1

        /***********************************************************************

            Connection notifier used by the client (see the outer class' ctor).

            Params:
                node_address = address/port of node which notification refers to
                e = exception instance indicating an error (null indicates
                    connection success)

        ***********************************************************************/

        private void connectionNotifier ( RawClient.Neo.ConnNotification info)
        {
            with (info.Active) switch (info.active)
            {
            case connected:
                log.trace("Neo connection established (on {}:{})",
                    info.connected.node_addr.address_bytes,
                    info.connected.node_addr.port);

                if (this.connect_task && this.connect_task.suspended())
                    this.connect_task.resume();

                break;
            case error_while_connecting:
                with (info.error_while_connecting)
                {
                    this.connection_error = true;
                    log.error("Neo connection error: {} (on {}:{})",
                            getMsg(e),
                            node_addr.address_bytes, node_addr.port);
                }
                break;
            default:
                assert(false);
            }
        }
nemanja-boric-sociomantic commented 6 years ago

Btw, there's also stuff in src/dlsproto/client/UsageExamples.d which you may find useful.

daniel-zullo commented 6 years ago

Addressed in #34