+func (c *Control) controlLoop() {
+ for {
+ msg := <-c.rcChan
+ switch msg.Mtype {
+ case xapp.RICMessageTypes["RIC_SUB_REQ"]:
+ c.handleSubscriptionRequest(msg)
+ case xapp.RICMessageTypes["RIC_SUB_RESP"]:
+ c.handleSubscriptionResponse(msg)
+ case xapp.RICMessageTypes["RIC_SUB_DEL_REQ"]:
+ c.handleSubscriptionDeleteRequest(msg)
+ case xapp.RICMessageTypes["RIC_SUB_DEL_RESP"]:
+ c.handleSubscriptionDeleteResponse(msg)
+ default:
+ err := errors.New("Message Type " + strconv.Itoa(msg.Mtype) + " is discarded")
+ xapp.Logger.Error("Unknown message type: %v", err)
+ }
+ }
+}
+