@ionic/discover

  • Version 3.1.5
  • Published
  • 21 kB
  • 4 dependencies
  • MIT license

Install

npm i @ionic/discover
yarn add @ionic/discover
pnpm add @ionic/discover

Overview

Simple UDP based protocol for service discovery implemented in pure JS.

Index

Functions

function computeBroadcastAddress

computeBroadcastAddress: (address: string, netmask: string) => string;

    function newSilentPublisher

    newSilentPublisher: (namespace: string, name: string, port: number) => Publisher;

      Classes

      class CommServer

      class CommServer extends events.EventEmitter {}

        constructor

        constructor(namespace: string, id: string, port: number);

          property clients

          readonly clients: Set<any>;

            property id

            id: string;
            • Unique identifier of the publisher.

            property namespace

            namespace: string;

              property port

              port: number;
              • Port of communication server.

              property server

              protected server?: any;

                method start

                start: () => Promise<void>;

                  method stop

                  stop: () => Promise<void>;

                    class Publisher

                    class Publisher extends events.EventEmitter implements IPublisherEventEmitter {}

                      constructor

                      constructor(namespace: string, name: string, port: number, commPort?: number);

                        property client

                        protected client?: any;

                          property commPort

                          commPort?: number;

                            property id

                            readonly id: string;

                              property interfaces

                              interfaces?: Interface[];

                                property interval

                                protected interval: number;

                                  property name

                                  name: string;

                                    property namespace

                                    namespace: string;

                                      property path

                                      readonly path: string;

                                        property port

                                        port: number;

                                          property running

                                          running: boolean;

                                            property timer

                                            protected timer?: any;

                                              method buildMessage

                                              protected buildMessage: (ip: string) => PublisherMessage;

                                                method getInterfaces

                                                protected getInterfaces: () => Interface[];

                                                  method sayHello

                                                  protected sayHello: () => void;

                                                    method start

                                                    start: () => Promise<void>;

                                                      method stop

                                                      stop: () => void;

                                                        Interfaces

                                                        interface CommServer

                                                        interface CommServer {}

                                                          method on

                                                          on: {
                                                          (event: 'error', listener: (err: Error) => void): this;
                                                          (
                                                          event: 'connect',
                                                          listener: (data: CommServerConnectionPayload) => void
                                                          ): this;
                                                          };

                                                            Package Files (3)

                                                            Dependencies (4)

                                                            Dev Dependencies (11)

                                                            Peer Dependencies (0)

                                                            No peer dependencies.

                                                            Badge

                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@ionic/discover.

                                                            • Markdown
                                                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@ionic/discover)
                                                            • HTML
                                                              <a href="https://www.jsdocs.io/package/@ionic/discover"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>