Example #1
0
        static void appClient_OnBroadCast(LJC.FrameWork.SocketApplication.Message obj)
        {
            //throw new NotImplementedException();
            string msg = LJC.FrameWork.EntityBuf.EntityBufCore.DeSerialize <string>(obj.MessageBuffer);

            Console.WriteLine("收到广播消息:" + msg);
        }
Example #2
0
 protected override byte[] DoMessage(LJC.FrameWork.SocketApplication.Message message)
 {
     if (message.IsMessage((int)SOAMessageType.RegisterService))
     {
         return(message.MessageBuffer);
     }
     else if (message.IsMessage((int)SOAMessageType.UnRegisterService))
     {
         return(message.MessageBuffer);
     }
     return(base.DoMessage(message));
 }
Example #3
0
        static void client_LoginSuccess()
        {
            Console.WriteLine("登录成功");

            System.Threading.Tasks.Parallel.For(0, 20, (no) =>
            {
                for (int i = 0; i < 100; i++)
                {
                    var msg = new LJC.FrameWork.SocketApplication.Message
                    {
                        MessageHeader = new LJC.FrameWork.SocketApplication.MessageHeader
                        {
                            TransactionID = LJC.FrameWork.SocketApplication.SocketApplicationComm.GetSeqNum(),
                            MessageType   = 10240
                        }
                    };
                    msg.SetMessageBody("hello");
                    Console.WriteLine(no + "发送消息:" + msg.MessageHeader.TransactionID);
                    var str = client.SendMessageAnsy <string>(msg, 5000);
                    Console.WriteLine(no + "收到消息:" + str);
                }
            });



            //var resp = LJC.FrameWork.SOA.ESBClient.DoSOARequest<LJC.FrameWork.SOA.SOAServerEchoResponse>(0, 1, null);

            //var ms = Environment.TickCount;

            //for(int i=0;i<100000;i++)
            //{
            //    resp = LJC.FrameWork.SOA.ESBClient.DoSOARequest<LJC.FrameWork.SOA.SOAServerEchoResponse>(0, 1, null);
            //}

            //Console.WriteLine("用时ms:" + (Environment.TickCount - ms));
        }
Example #4
0
        static void appClient_OnMultiCast(LJC.FrameWork.SocketApplication.Message obj)
        {
            string msg = LJC.FrameWork.EntityBuf.EntityBufCore.DeSerialize <string>(obj.MessageBuffer);

            Console.WriteLine("收到组播消息:" + msg);
        }