You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
759 B
33 lines
759 B
4 years ago
|
import { RemoteInfo } from 'dgram';
|
||
|
|
||
|
/**
|
||
|
* @fires IServer#message
|
||
|
*/
|
||
|
export interface IServer {
|
||
|
/**
|
||
|
*
|
||
|
* @param msg
|
||
|
* @param port
|
||
|
* @param address
|
||
|
* @param callback
|
||
|
* @param expectAcknowledgment: if set to false, message is not retried to send again if there is no confirmation
|
||
|
*/
|
||
|
sendToClient(
|
||
|
msg: string | Uint8Array,
|
||
|
port?: number,
|
||
|
address?: string,
|
||
|
callback?: (error: Error | null, bytes: number) => void,
|
||
|
expectAcknowledgment?: boolean
|
||
|
): void;
|
||
|
|
||
|
/**
|
||
|
* Message event.
|
||
|
*
|
||
|
* @event IServer#message
|
||
|
* @type {object}
|
||
|
* @property {message} data - the data of the incoming message
|
||
|
* @property {rinfo} optionally remote information
|
||
|
*/
|
||
|
on(event: 'message', listener: (msg: Buffer, rinfo?: RemoteInfo) => void): this;
|
||
|
}
|