func (c *Client) Stop() {
	if atomic.LoadInt32(&c.State.Done) == 1 {
		return
	}

	c.State.endOnce.Do(func() {
		c.r.Stop()
		c.w.Stop()
		c.State.endedW.Wait()

		c.conn.Close()

		c.State.endedR.Wait()
		atomic.StoreInt32(&c.State.Done, 1)
	})
}
// Stop instructs the client to shut down all processing goroutines and disconnect.
Stop instructs the client to shut down all processing goroutines and disconnect.
// Stop instructs the client to shut down all processing goroutines and disconnect .
func (c *Client) Stop() {
	if atomic.LoadInt32(&c.State.Done) == 1 {
		return
	}
	c.State.endOnce.Do(func() {
		c.r.Stop()
		c.w.Stop()
		c.State.endedW.Wait()
		c.conn.Close()
		c.State.endedR.Wait()
		atomic.StoreInt32(&c.State.Done, 1)
	})
}
func ( c * Client ) Stop ( ) { if atomic . LoadInt32 ( & c . State . Done ) == 1 { return } c . State . endOnce . Do ( func ( ) { c . r . Stop ( ) c . w . Stop ( ) c . State . endedW . Wait ( ) c . conn . Close ( ) c . State . endedR . Wait ( ) atomic . StoreInt32 ( & c . State . Done , 1 ) } ) }
Stop instructs the client to shut down all processing goroutines and disconnect.
Stop instructs the client to shut down all processing goroutines and disconnect .