code: func New(opts *Options) *Client {
  	// Initialize the options.
  	if opts == nil {
  		opts = &Options{}
  	}
  	// Create a Client.
  	cli := &Client{
  		disconnc:     make(chan struct{}, 1),
  		disconnEndc:  make(chan struct{}),
  		errorHandler: opts.ErrorHandler,
  	}
  
  	// Launch a goroutine which disconnects the Network Connection.
  	cli.wg.Add(1)
  	go func() {
  		defer func() {
  			cli.wg.Done()
  		}()
  
  		for {
  			select {
  			case <-cli.disconnc:
  				if err := cli.Disconnect(); err != nil {
  					if cli.errorHandler != nil {
  						cli.errorHandler(err)
  					}
  				}
  			case <-cli.disconnEndc:
  				// End the goroutine.
  				return
  			}
  		}
  
  	}()
  
  	// Return the Client.
  	return cli
  }
docs: // New creates and returns a Client.