code: func (h *BasicHost) newStreamHandler(s inet.Stream) {
  	before := time.Now()
  
  	if h.negtimeout > 0 {
  		if err := s.SetDeadline(time.Now().Add(h.negtimeout)); err != nil {
  			log.Error("setting stream deadline: ", err)
  			s.Reset()
  			return
  		}
  	}
  
  	lzc, protoID, handle, err := h.Mux().NegotiateLazy(s)
  	took := time.Now().Sub(before)
  	if err != nil {
  		if err == io.EOF {
  			logf := log.Debugf
  			if took > time.Second*10 {
  				logf = log.Warningf
  			}
  			logf("protocol EOF: %s (took %s)", s.Conn().RemotePeer(), took)
  		} else {
  			log.Debugf("protocol mux failed: %s (took %s)", err, took)
  		}
  		s.Reset()
  		return
  	}
  
  	s = &streamWrapper{
  		Stream: s,
  		rw:     lzc,
  	}
  
  	if h.negtimeout > 0 {
  		if err := s.SetDeadline(time.Time{}); err != nil {
  			log.Error("resetting stream deadline: ", err)
  			s.Reset()
  			return
  		}
  	}
  
  	s.SetProtocol(protocol.ID(protoID))
  	log.Debugf("protocol negotiation took %s", took)
  
  	go handle(protoID, s)
  }
docs: // newStreamHandler is the remote-opened stream handler for inet.Network
  // TODO: this feels a bit wonky