code: func newConnection(network, address string, tlsConfig *tls.Config) (*connection, error) {
  	// Define the local variables.
  	var conn net.Conn
  	var err error
  
  	// Connect to the address on the named network.
  	if tlsConfig != nil {
  		conn, err = tls.Dial(network, address, tlsConfig)
  	} else {
  		conn, err = net.Dial(network, address)
  	}
  	if err != nil {
  		return nil, err
  	}
  
  	// Create a Network Connection.
  	c := &connection{
  		Conn:      conn,
  		r:         bufio.NewReader(conn),
  		w:         bufio.NewWriter(conn),
  		connack:   make(chan struct{}, 1),
  		send:      make(chan packet.Packet, sendBufSize),
  		sendEnd:   make(chan struct{}, 1),
  		unackSubs: make(map[string]MessageHandler),
  		ackedSubs: make(map[string]MessageHandler),
  	}
  
  	// Return the Network Connection.
  	return c, nil
  }
docs: // newConnection connects to the address on the named network,
  // creates a Network Connection and returns it.