// ServeConn starts serving the incoming connection
ServeConn starts serving the incoming connection
// ServeConn starts serving the incoming connection
func (mh *MessageHandle) ServeConn(hi hubio.CloudHubIO, info *model.HubInfo) {
	err := mh.EnrollNode(hi, info)
	if err != nil {
		klog.Errorf("fail to enroll node %s, reason %s", info.NodeID, err.Error())
		return
	}
	klog.Infof("edge node %s for project %s connected", info.NodeID, info.ProjectID)
	stop := make(chan ExitCode, 2)
	for _, handle := range mh.Handlers {
		go handle(hi, info, stop)
	}
	code := <-stop
	mh.CancelNode(hi, info, code)
}
func ( mh * MessageHandle ) ServeConn ( hi hubio . CloudHubIO , info * model . HubInfo ) { err := mh . EnrollNode ( hi , info ) if err != nil { klog . Errorf ( " " , info . NodeID , err . Error ( ) ) return } klog . Infof ( " " , info . NodeID , info . ProjectID ) stop := make ( chan ExitCode , 2 ) for _ , handle := range mh . Handlers { go handle ( hi , info , stop ) } code := <- stop mh . CancelNode ( hi , info , code ) }
ServeConn starts serving the incoming connection
ServeConn starts serving the incoming connection