Example #1
0
 public void DeliverEnd()
 {
     mBlinkConn = null;
     if (mListener != null)
     {
         mListener.OnSendEnd(IsSucceed());
     }
 }
Example #2
0
 public void Cancel()
 {
     mCanceled = true;
     if (mBlinkConn != null)
     {
         mBlinkConn.Cancel(this);
         mBlinkConn = null;
     }
 }
Example #3
0
 /// <summary>
 /// Cancel the packet to send
 /// If the packet on sending you can't cancel it
 /// But you can cancel sending notify callback
 /// </summary>
 public void Cancel()
 {
     mCanceled = true;
     if (mBlinkConn != null)
     {
         mBlinkConn.Cancel(this);
         mBlinkConn = null;
     }
 }
Example #4
0
        static void Main(string[] args)
        {
            BlinkLog.I("=========PRESS ENTER IP eg(127.0.0.1)==========");
            string ip = Console.ReadLine();

            IPAddress hostIp;
            if (!IPAddress.TryParse(ip, out hostIp))
            {
                Console.ReadKey();
                return;
            }

            try
            {
                mSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                mSocket.Connect(hostIp, 2626);
                mBlinkConn = Blink.NewConnection(mSocket, 1024 * 1024, "D:/", Guid.NewGuid().ToString(), 0.01f, null, null);

            }
            catch (Exception)
            {
                BlinkLog.I("LINK TO: " + hostIp + " ERROR.");
                Console.ReadKey();
                return;
            }

            BlinkLog.I("=========PRESS ENTER 'E' TO EXIT==========");

            SendWhlie();

            if (mBlinkConn != null)
                mBlinkConn.Dispose();
            if (mSocket != null)
            {
                mSocket.Dispose();
                mSocket.Close();
            }
        }
Example #5
0
 public SendPacket SetBlinkConn(BlinkConn blinkConn)
 {
     mBlinkConn = blinkConn;
     return(this);
 }
Example #6
0
 /// <summary>
 /// Set The BlinkConn to Cancel from queue
 /// </summary>
 /// <param name="blinkConn">BlinkConn</param>
 /// <returns>SendPacket</returns>
 public SendPacket SetBlinkConn(BlinkConn blinkConn)
 {
     mBlinkConn = blinkConn;
     return this;
 }
Example #7
0
 public ReceiveDispatcher(IReceiver receiver, IReceiveDelivery delivery, BlinkConn blinkConn)
 {
     mReceiver  = receiver;
     mDelivery  = delivery;
     mBlinkConn = blinkConn;
 }