static void Main(string[] args) { Console.Title = "PushConsumer"; Task.Run(() => { Console.WriteLine("start push consumer..."); var consumerPtr = PushConsumerWrap.CreatePushConsumer("xxx"); var p = new Program(); var consumer = new HandleRef(p, consumerPtr); Console.WriteLine($"consumer: {consumer}"); var r0 = PushConsumerWrap.SetPushConsumerLogLevel(consumer, CLogLevel.E_LOG_LEVEL_TRACE); var groupId = PushConsumerWrap.GetPushConsumerGroupID(consumer.Handle); Console.WriteLine($"groupId: {groupId}"); var r1 = PushConsumerWrap.SetPushConsumerNameServerAddress(consumer, "47.101.55.250:9876"); var r2 = PushConsumerWrap.Subscribe(consumer, "test", "*"); var r3 = PushConsumerWrap.RegisterMessageCallback(consumer, _callback); var r10 = PushConsumerWrap.StartPushConsumer(consumer); Console.WriteLine($"start push consumer ptr: {r10}"); while (true) { Thread.Sleep(500); } }); Console.ReadKey(true); //PushConsumerBinder.DestroyPushConsumer(consumer); }
public bool StartPushConsumer() { var startResult = PushConsumerWrap.StartPushConsumer(this._handleRef); return(startResult == 0); }