mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-26 20:32:02 -08:00
parent
7e596fc33c
commit
8794ea6ed8
@ -189,7 +189,10 @@ func (c *Client) Resume(state SMState) error {
|
|||||||
func (c *Client) Disconnect() {
|
func (c *Client) Disconnect() {
|
||||||
_ = c.SendRaw("</stream:stream>")
|
_ = c.SendRaw("</stream:stream>")
|
||||||
// TODO: Add a way to wait for stream close acknowledgement from the server for clean disconnect
|
// TODO: Add a way to wait for stream close acknowledgement from the server for clean disconnect
|
||||||
_ = c.conn.Close()
|
conn := c.conn
|
||||||
|
if conn != nil {
|
||||||
|
_ = conn.Close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) SetHandler(handler EventHandler) {
|
func (c *Client) SetHandler(handler EventHandler) {
|
||||||
|
@ -123,7 +123,10 @@ func (c *Component) Resume(sm SMState) error {
|
|||||||
func (c *Component) Disconnect() {
|
func (c *Component) Disconnect() {
|
||||||
_ = c.SendRaw("</stream:stream>")
|
_ = c.SendRaw("</stream:stream>")
|
||||||
// TODO: Add a way to wait for stream close acknowledgement from the server for clean disconnect
|
// TODO: Add a way to wait for stream close acknowledgement from the server for clean disconnect
|
||||||
_ = c.conn.Close()
|
conn := c.conn
|
||||||
|
if conn != nil {
|
||||||
|
_ = conn.Close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Component) SetHandler(handler EventHandler) {
|
func (c *Component) SetHandler(handler EventHandler) {
|
||||||
|
Loading…
Reference in New Issue
Block a user