public void Handle(ESBRequest request) { if (request.Type == ESBRequest._Type.ACTION) { ReceiveDataRequest(Encoder.DecodeESBDataRequest(request.Data)); } else if (request.Type == ESBRequest._Type.BROADCAST) { ReceiveBroadcast(Encoder.DecodeBroadcast(request.Data)); } }
public static byte[] EncodeESBRequest(ESBRequest node) { return(Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(node, Formatting.None) + "<EOF>")); }