Skip to content

Commit

Permalink
Add missing methods to WsContext (#232)
Browse files Browse the repository at this point in the history
* Add ping methods to `WsContext`

* Add several more missing methods

* Change `enableAutomaticPings` docs
  • Loading branch information
zugazagoitia committed May 11, 2023
1 parent 7537a20 commit e4941a4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pages/docs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ messages to the client.
send(obj) // serialize object to json string and send it to client
send("message") // send string to client
send(byteBuffer) // send bytes to client
sendAsClass(obj, clazz) // serialize object to json string and send it to client

// Upgrade Context methods (getters)
matchedPath() // get the path that was used to match this request (ex, "/hello/{name}")
Expand Down Expand Up @@ -535,6 +536,16 @@ attributeMap() // map of all attributes on the request
sessionAttribute("name") // get a session attribute
sessionAttributeMap() // map of all session attributes
sendPing() // send a ping to the client
sendPing(bytes) // send a ping with data to the client
enableAutomaticPings() // enable automatic pinging to avoid timeouts
enableAutomaticPings(1, HOURS, bytes) // enable automatic pinging with custom interval and/or data
disableAutomaticPings() // disable automatic pinging
closeSession() // close the session
closeSession(closeStatus) // close the session with a CloseStatus
closeSession(400, "reason") // close the session with a status and reason
```
#### WsMessageContext
Expand Down

0 comments on commit e4941a4

Please sign in to comment.