示例#1
0
        void Startup()
        {
            CustomeEventArgs _args1 = new CustomeEventArgs("AcceptAsync");

            _args1.Complete += OnAcceptCallback;
            socket.AcceptAsync(_args1);

            CustomeEventArgs _args2 = new CustomeEventArgs("ReceiveAsync");

            _args2.Complete += OnReceiveCallback;
            socket.ReceiveAsync(_args2);

            CustomeEventArgs _args3 = new CustomeEventArgs("SendAsync");

            _args3.Complete += OnSendCallback;
            socket.SendAsync(_args3);

            System.Threading.Thread _thread = new System.Threading.Thread(socket.Startup);
            _thread.Start();
        }
示例#2
0
 public void SendAsync(CustomeEventArgs _args)
 {
     sendArgs = _args;
 }
示例#3
0
 public void ReceiveAsync(CustomeEventArgs _args)
 {
     receiveArgs = _args;
 }
示例#4
0
 public void AcceptAsync(CustomeEventArgs _args)
 {
     acceptArgs = _args;
 }
示例#5
0
 void OnSendCallback(object _obj, CustomeEventArgs _sendArgs)
 {
     Console.WriteLine(" > OnSendCallback:" + _sendArgs.msg + " > " + _sendArgs.callCount);
 }
示例#6
0
 void OnReceiveCallback(object _obj, CustomeEventArgs _receiveArgs)
 {
     Console.WriteLine(" > OnReceiveCallback:" + _receiveArgs.msg + " > " + _receiveArgs.callCount);
 }
示例#7
0
 void OnAcceptCallback(object _obj, CustomeEventArgs _acceptArgs)
 {
     Console.WriteLine(" > OnAcceptCallback:" + _acceptArgs.msg + " > " + _acceptArgs.callCount);
 }