interface Socket { bind(port?: number,
address?: string,
callback?: (() => void)): this; bind(port?: number,
callback?: (() => void)): this; bind(callback?: (() => void)): this; bind(options: BindOptions,
callback?: (() => void)): this; close(callback?: (() => void)): this; on(event: "message",
listener: ((msg: Buffer,
rinfo: RemoteInfo) => void)): this; send(msg: string | Uint8Array,
port?: number,
address?: string,
callback?: ((error: null | Error,
bytes: number) => void)): void; send(msg: string | Uint8Array,
port?: number,
callback?: ((error: null | Error,
bytes: number) => void)): void; send(msg: string | Uint8Array,
callback?: ((error: null | Error,
bytes: number) => void)): void; send(msg: string | Uint8Array,
offset: number,
length: number,
port?: number,
address?: string,
callback?: ((error: null | Error,
bytes: number) => void)): void; send(msg: string | Uint8Array,
offset: number,
length: number,
port?: number,
callback?: ((error: null | Error,
bytes: number) => void)): void; send(msg: string | Uint8Array,
offset: number,
length: number,
callback?: ((error: null | Error,
bytes: number) => void)): void; } Methods
bind
- bind(port?, address?, callback?): this
Parameters
Optionalport: numberOptionaladdress: stringOptionalcallback: (() => void)
Returns this
- bind(port?, callback?): this
Parameters
Optionalport: numberOptionalcallback: (() => void)
Returns this
- bind(callback?): this
Parameters
Optionalcallback: (() => void)
Returns this
- bind(options, callback?): this
Parameters
- options: BindOptions
Optionalcallback: (() => void)
Returns this
close
- close(callback?): this
Parameters
Optionalcallback: (() => void)
Returns this
on
- on(event, listener): this
Parameters
- event: "message"
- listener: ((msg: Buffer, rinfo: RemoteInfo) => void)
- (msg, rinfo): void
Parameters
- msg: Buffer
- rinfo: RemoteInfo
Returns void
Returns this
send
- send(msg, port?, address?, callback?): void
Parameters
- msg: string | Uint8Array
Optionalport: numberOptionaladdress: stringOptionalcallback: ((error: null | Error, bytes: number) => void)- (error, bytes): void
Parameters
- error: null | Error
- bytes: number
Returns void
Returns void
- send(msg, port?, callback?): void
Parameters
- msg: string | Uint8Array
Optionalport: numberOptionalcallback: ((error: null | Error, bytes: number) => void)- (error, bytes): void
Parameters
- error: null | Error
- bytes: number
Returns void
Returns void
- send(msg, callback?): void
Parameters
- msg: string | Uint8Array
Optionalcallback: ((error: null | Error, bytes: number) => void)- (error, bytes): void
Parameters
- error: null | Error
- bytes: number
Returns void
Returns void
- send(msg, offset, length, port?, address?, callback?): void
Parameters
- msg: string | Uint8Array
- offset: number
- length: number
Optionalport: numberOptionaladdress: stringOptionalcallback: ((error: null | Error, bytes: number) => void)- (error, bytes): void
Parameters
- error: null | Error
- bytes: number
Returns void
Returns void
- send(msg, offset, length, port?, callback?): void
Parameters
- msg: string | Uint8Array
- offset: number
- length: number
Optionalport: numberOptionalcallback: ((error: null | Error, bytes: number) => void)- (error, bytes): void
Parameters
- error: null | Error
- bytes: number
Returns void
Returns void
- send(msg, offset, length, callback?): void
Parameters
- msg: string | Uint8Array
- offset: number
- length: number
Optionalcallback: ((error: null | Error, bytes: number) => void)- (error, bytes): void
Parameters
- error: null | Error
- bytes: number
Returns void
Returns void