code: func (s *RPCServer) ServeConn(conn io.ReadWriteCloser) {
  	// First create the yamux server to wrap this connection
  	mux, err := yamux.Server(conn, nil)
  	if err != nil {
  		conn.Close()
  		log.Printf("[ERR] plugin: error creating yamux server: %s", err)
  		return
  	}
  
  	// Accept the control connection
  	control, err := mux.Accept()
  	if err != nil {
  		mux.Close()
  		if err != io.EOF {
  			log.Printf("[ERR] plugin: error accepting control connection: %s", err)
  		}
  
  		return
  	}
  
  	// Connect the stdstreams (in, out, err)
  	stdstream := make([]net.Conn, 2)
  	for i, _ := range stdstream {
  		stdstream[i], err = mux.Accept()
  		if err != nil {
  			mux.Close()
  			log.Printf("[ERR] plugin: accepting stream %d: %s", i, err)
  			return
  		}
  	}
  
  	// Copy std streams out to the proper place
  	go copyStream("stdout", stdstream[0], s.Stdout)
  	go copyStream("stderr", stdstream[1], s.Stderr)
  
  	// Create the broker and start it up
  	broker := newMuxBroker(mux)
  	go broker.Run()
  
  	// Use the control connection to build the dispenser and serve the
  	// connection.
  	server := rpc.NewServer()
  	server.RegisterName("Control", &controlServer{
  		server: s,
  	})
  	server.RegisterName("Dispenser", &dispenseServer{
  		broker:  broker,
  		plugins: s.Plugins,
  	})
  	server.ServeConn(control)
  }
docs: // ServeConn runs a single connection.
  //
  // ServeConn blocks, serving the connection until the client hangs up.