code: func (p *Peer) start() error {
  	log.Tracef("Starting peer %s", p)
  
  	negotiateErr := make(chan error, 1)
  	go func() {
  		if p.inbound {
  			negotiateErr <- p.negotiateInboundProtocol()
  		} else {
  			negotiateErr <- p.negotiateOutboundProtocol()
  		}
  	}()
  
  	// Negotiate the protocol within the specified negotiateTimeout.
  	select {
  	case err := <-negotiateErr:
  		if err != nil {
  			p.Disconnect()
  			return err
  		}
  	case <-time.After(negotiateTimeout):
  		p.Disconnect()
  		return errors.New("protocol negotiation timeout")
  	}
  	log.Debugf("Connected to %s", p.Addr())
  
  	// The protocol has been negotiated successfully so start processing input
  	// and output messages.
  	go p.stallHandler()
  	go p.inHandler()
  	go p.queueHandler()
  	go p.outHandler()
  	go p.pingHandler()
  
  	// Send our verack message now that the IO processing machinery has started.
  	p.QueueMessage(wire.NewMsgVerAck(), nil)
  	return nil
  }
docs: // start begins processing input and output messages.