static void Instance_ListenerEventMessage(object sender, MessageListenerEventArgs e) { Console.WriteLine("[{0}]监听器事件--From: {1}:{2}\r\n[{3}]", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), e.Listener.FromIP, e.Listener.FromPort, e.MessageText); }
static void Instance_ListenerAdded(object sender, MessageListenerEventArgs e) { Console.WriteLine("[{0}]订阅消息--From: {1}:{2}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), e.Listener.FromIP, e.Listener.FromPort); }
static void Instance_ListenerAcceptMessage(object sender, MessageListenerEventArgs e) { Console.WriteLine("[{0}]接收消息--From: {1}:{2},Identity:{3}\r\n>>{4}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), e.Listener.FromIP, e.Listener.FromPort, e.Listener.GetIdentity(), e.Listener.FromMessage); e.Listener.Notify(0, "收到!"); }