background image
C H A P T E R 2 3
Endpoint Interface
Summary of the Endpoint Interface
23-29
Input: // returns data from input buffer and clears it
func() ...,
Partial: // returns data from input buffer
func() ...,
FlushInput: // flushes whole input buffer
func() ...,
FlushPartial: // flushes input buffer previously read
func() ...,
Cancel: // cancels operations
func(
callbackSpec
) ...,
Option: // sets & gets options
func(
options
,
callbackSpec
) ...,
ExceptionHandler: // called on exceptions
func(
error
) ...,
EventHandler: // called on unhandled events
func(
event
) ...,
State: // returns endpoint state
func() ...,
...
}
protoStreamingEndpoint
23
myStreamEndpoint := {
_proto: protoStreamingEndpoint, // proto endpoint
StreamIn: // receives stream data
func({
form: 'frame, // required
reqTimeout:
integer
, // time-out in ms.
rcvFlags:
integer
, // receive flag constant(s)
target: {
store:
store
}, // store for VBOs
ProgressScript: // progress callback
func(
bytes
,
totalBytes
)...
}) ...,
StreamOut: // sends stream data
func(
data
,
{form: 'frame, // required
reqTimeout:
integer
, // time-out in ms.
sendFlags:
integer
, // send flag constant(s)
ProgressScript: // progress callback
func(
bytes
,
totalBytes
)...
}) ...,
...
}
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна