Exemple #1
0
 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);
 }
Exemple #2
0
 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);
 }
Exemple #3
0
 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, "收到!");
 }