Methods
public addListener( event: string , listener: () => void ) : IBufferList
Parameters
event: string
listener: () => void
Returns
IBufferList
public addListener( event: "'advance'" , cb: (n: number) => void ) : IBufferList
Parameters
event: "'advance'"
cb: (n: number) => void
Returns
IBufferList
public addListener( event: "'write'" , cb: (buf: Buffer) => void ) : IBufferList
Parameters
event: "'write'"
cb: (buf: Buffer) => void
Returns
IBufferList
public advance( n: number ) : IBufferList
Defined in cket/websocket.d.ts:279
Advance the buffer stream by n
bytes.
If n
the aggregate advance offset passes the end of the buffer list,
operations such as take
will return empty strings until enough data is pushed.
Parameters
Returns
IBufferList
public emit( event: string , args?: Array<any> ) : boolean
Parameters
event: string
args?: Array<any> optional
Returns
boolean
public end( buf: Buffer )
Defined in cket/websocket.d.ts:260
Parameters
public forEach( fn: (buf: Buffer) => boolean )
Defined in cket/websocket.d.ts:266
For each buffer, perform some action.
If fn's result is a true value, cut out early.
Parameters
fn: (buf: Buffer) => boolean
public join( start: number , end: number ) : Buffer
Defined in cket/websocket.d.ts:269
Create a single buffer out of all the chunks
Parameters
start: number
end: number
Returns
Buffer
public joinInto( buf: Buffer , offset: number , start: number , end: number ) : Buffer
Defined in cket/websocket.d.ts:272
Join all the chunks to existing buffer
Parameters
offset: number
start: number
end: number
Returns
Buffer
public listeners( event: string ) : Array<Function>
Parameters
Returns
Array<Function>
public on( event: string , listener: () => void ) : IBufferList
Parameters
event: string
listener: () => void
Returns
IBufferList
public on( event: "'advance'" , cb: (n: number) => void ) : IBufferList
Parameters
event: "'advance'"
cb: (n: number) => void
Returns
IBufferList
public on( event: "'write'" , cb: (buf: Buffer) => void ) : IBufferList
Parameters
event: "'write'"
cb: (buf: Buffer) => void
Returns
IBufferList
public once( event: string , listener: Function ) : EventEmitter
Parameters
event: string
listener: Function
Returns
EventEmitter
public removeListener( event: string , listener: Function ) : EventEmitter
Parameters
event: string
listener: Function
Returns
EventEmitter
public setMaxListeners( n: number )
Parameters
public take( n: number , encoding?: string ) : any
Defined in cket/websocket.d.ts:286
Take n
bytes from the start of the buffers.
If there are less than n
bytes in all the buffers or n
is undefined,
returns the entire concatenated buffer string.
Parameters
n: number
encoding?: string optional
Returns
any
public take( encoding?: string ) : any
Defined in cket/websocket.d.ts:287
Parameters
encoding?: string optional
Returns
any
public write( buf: Buffer ) : boolean
Defined in cket/websocket.d.ts:259
Parameters
Returns
boolean