@ionic/discover
- Version 3.1.8
- Published
- 14.6 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<WebSocket>;
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?: WebSocket.Server;
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?: dgram.Socket;
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?: NodeJS.Timer;
method buildMessage
protected buildMessage: (ip: string) => PublisherMessage;
method getInterfaces
protected getInterfaces: () => Interface[] | undefined;
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 oneto 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[](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>
- Updated .
Package analyzed in 2586 ms. - Missing or incorrect documentation? Open an issue for this package.