Beispiel #1
0
        private void method_2(SocketAsyncEventArgs socketAsyncEventArgs_0)
        {
            SocketError socketError = SocketError.Success;

            try
            {
                MySocketEventArgs obj = (MySocketEventArgs)socketAsyncEventArgs_0;
                socketError = obj.SocketError;
                obj.IsUsing = false;
                obj.SetBuffer(null, 0, 0);
                obj.Completed -= method_1;
                obj.Dispose();
            }
            catch
            {
            }
            try
            {
                if (socketError != 0)
                {
                    method_4();
                }
                else if (onSend_0 != null)
                {
                    onSend_0();
                }
            }
            catch
            {
            }
        }
Beispiel #2
0
        private MySocketEventArgs method_0()
        {
            MySocketEventArgs obj = new MySocketEventArgs
            {
                UserToken      = clientSocket,
                RemoteEndPoint = ipendPoint_0,
                IsUsing        = false
            };

            obj.Completed += new EventHandler <SocketAsyncEventArgs>(method_1);
            Interlocked.Increment(ref int_0);
            obj.ArgsTag = int_0;
            return(obj);
        }
Beispiel #3
0
        public void Send(byte[] sendBuffer, bool issync = false)
        {
            MySocketEventArgs mySocketEventArgs = method_0();

            try
            {
                if (arc4_0 != null)
                {
                    arc4_0.encrypt(sendBuffer);
                }
                mySocketEventArgs.IsUsing = true;
                mySocketEventArgs.SetBuffer(sendBuffer, 0, sendBuffer.Length);
                if (clientSocket != null && !clientSocket.SendAsync(mySocketEventArgs))
                {
                    method_2(mySocketEventArgs);
                }
            }
            catch
            {
            }
        }