Add IsAlive() method on client

This commit is contained in:
wpetit 2020-11-23 16:23:03 +01:00
parent 420c3164d6
commit e3cc7ab2b1
1 changed files with 8 additions and 0 deletions

View File

@ -78,6 +78,14 @@ func (c *Client) Close() {
c.conn = nil
}
func (c *Client) IsAlive() bool {
if c.conn == nil {
return false
}
return c.conn.IsAlive()
}
// Emit a new event with the given data
func (c *Client) Emit(event string, data interface{}) error {
// enc := json.NewEncoder(os.Stdout)