Skip to content

Commit

Permalink
Add the pong() command to the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoglan committed Jul 4, 2015
1 parent 90b8c9d commit 4dd872f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -21,7 +21,7 @@ this module up to some I/O object, it will do all of this for you:
* Deal with proxies that defer delivery of the draft-76 handshake body
* Notify you when the socket is open and closed and when messages arrive
* Recombine fragmented messages
* Dispatch text, binary, ping and close frames
* Dispatch text, binary, ping, pong and close frames
* Manage the socket-closing handshake process
* Automatically reply to ping frames with a matching pong
* Apply masking to messages sent by the client
Expand Down Expand Up @@ -330,6 +330,15 @@ callback are both optional. If a callback is given, it will be invoked when the
socket receives a pong frame whose content matches `string`. Returns `false` if
frames can no longer be sent, or if the driver does not support ping/pong.

#### `driver.pong(string = '')`

Sends a pong frame over the socket, queueing it if necessary. `string` is
optional. Returns `false` if frames can no longer be sent, or if the driver does
not support ping/pong.

You don't need to call this when a ping frame is received; pings are replied to
automatically by the driver. This method is for sending unsolicited pongs.

#### `driver.close()`

Initiates the closing handshake if the socket is still open. For drivers with no
Expand Down

0 comments on commit 4dd872f

Please sign in to comment.