// OnRegister regist node on first connection
OnRegister regist node on first connection
// OnRegister regist node on first connection
func (mh *MessageHandle) OnRegister(connection conn.Connection) {
	nodeID := connection.ConnectionState().Headers.Get("node_id")
	projectID := connection.ConnectionState().Headers.Get("project_id")
	if _, ok := mh.KeepaliveChannel[nodeID]; !ok {
		mh.KeepaliveChannel[nodeID] = make(chan struct{}, 1)
	}
	io := &hubio.JSONIO{Connection: connection}
	go mh.ServeConn(io, &model.HubInfo{ProjectID: projectID, NodeID: nodeID})
}
func ( mh * MessageHandle ) OnRegister ( connection conn . Connection ) { nodeID := connection . ConnectionState ( ) . Headers . Get ( " " ) projectID := connection . ConnectionState ( ) . Headers . Get ( " " ) if _ , ok := mh . KeepaliveChannel [ nodeID ] ; ! ok { mh . KeepaliveChannel [ nodeID ] = make ( chan struct { } , 1 ) } io := & hubio . JSONIO { Connection : connection } go mh . ServeConn ( io , & model . HubInfo { ProjectID : projectID , NodeID : nodeID } ) }
OnRegister regist node on first connection
OnRegister regist node on first connection