Class server_poller
Defined in: client.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
server_poller(poll_delay, url, handler)
This object handles the polling and sending to/from the gateway.
|
| Method Attributes | Method Name and Description |
|---|---|
|
poll()
This function executes the poll.
|
|
|
send(message)
Send a message
|
|
|
Tell the poller that it should expect a message.
|
|
|
stop()
Stop the poller
|
Class Detail
server_poller(poll_delay, url, handler)
This object handles the polling and sending to/from the gateway.
See also the overview and examples.
- Parameters:
- {number} poll_delay
- the number of milliseconds between normal polls
- {string} url
- the URL of the server
- {function} handler
- the function to call to handle incoming messages
Method Detail
poll()
This function executes the poll.
send(message)
Send a message
- Parameters:
- {rock_datagram_message} message
- the message to send
setExpecting()
Tell the poller that it should expect a message. this speeds up the polling rate by a factor of 10.
You should not need to call this, because the poller does it automatically when you send a message,
until the reply is received.
The "expecting" status only holds until it receives a message.
stop()
Stop the poller