Skip to content

Commit

Permalink
Add SendKeepAlive method to send "whitespace keepalive"
Browse files Browse the repository at this point in the history
  • Loading branch information
joyrex2001 committed Mar 6, 2017
1 parent ac40267 commit a74ec7b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xmpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,11 @@ func (c *Client) SendPresence(presence Presence) (n int, err error) {
return fmt.Fprintf(c.conn, "<presence from='%s' to='%s'/>", xmlEscape(presence.From), xmlEscape(presence.To))
}

// SendKeepAlive sends a "whitespace keepalive" as described in chapter 4.6.1 of RFC6120.
func (c *Client) SendKeepAlive() (n int, err error) {
return fmt.Fprintf(c.conn," ")
}

// SendHtml sends the message as HTML as defined by XEP-0071
func (c *Client) SendHtml(chat Chat) (n int, err error) {
return fmt.Fprintf(c.conn, "<message to='%s' type='%s' xml:lang='en'>"+
Expand Down

0 comments on commit a74ec7b

Please sign in to comment.