Exemplo n.º 1
0
 public ReceiveDeliveryRunnable(BlinkListener listener, ReceivePacket entity, ProgressStatus status, bool isEnd)
 {
     this.listener = listener;
     this.entity   = entity;
     this.status   = status;
     this.isEnd    = isEnd;
 }
Exemplo n.º 2
0
        public EventDelivery(BlinkListener blinkListener, ReceiveListener receiveListener)
        {
            mBlinkPoster += ExecutorDelivery_BlinkPoster;
            mSendPoster += ExecutorDelivery_SendPoster;

            mBlinkListener = blinkListener;
            mReceiveListener = receiveListener;
        }
Exemplo n.º 3
0
 public void Run()
 {
     if (listener != null)
     {
         listener.OnBlinkDisconnect();
         listener = null;
     }
 }
Exemplo n.º 4
0
        public EventDelivery(BlinkListener blinkListener, ReceiveListener receiveListener)
        {
            mBlinkPoster += ExecutorDelivery_BlinkPoster;
            mSendPoster  += ExecutorDelivery_SendPoster;

            mBlinkListener   = blinkListener;
            mReceiveListener = receiveListener;
        }
Exemplo n.º 5
0
        public void PostBlinkDisconnect()
        {
            BlinkListener listener = mBlinkListener;

            if (listener != null)
            {
                PostQueue(listener.OnBlinkDisconnect);
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// Destroy the event
 /// </summary>
 public void Dispose()
 {
     mBlinkListener = null;
     Action action = null;
     while (mQueue.TryDequeue(out action))
     {
         action -= action;
     }
 }
Exemplo n.º 7
0
        public void PostBlinkDisconnect()
        {
            BlinkListener listener = mBlinkListener;

            if (listener != null)
            {
                PostBlink(new BlinkDeliveryRunnable(listener));
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// Create a Bink connection by socket
 /// </summary>
 /// <param name="socket">Socket</param>
 /// <param name="resourcePath">File Resource Path</param>
 /// <param name="progressPrecision">Send and Receive notify progress precision</param>
 /// <param name="receiveListener">ReceiveListener</param>
 /// <param name="blinkListener">BlinkListener</param>
 /// <returns>BlinkConn</returns>
 public static BlinkConn NewConnection(
     Socket socket,
     int socketBufferSize,
     String resourcePath,
     float progressPrecision,
     ReceiveListener receiveListener,
     BlinkListener blinkListener)
 {
     return(NewConnection(socket, socketBufferSize, resourcePath, Guid.NewGuid().ToString(), progressPrecision, receiveListener, blinkListener));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Create a Bink connection by socket
 /// </summary>
 /// <param name="socket">Socket</param>
 /// <param name="resourcePath">File Resource Path</param>
 /// <param name="fileMark">File name mark to clear and create</param>
 /// <param name="progressPrecision">Send and Receive notify progress precision</param>
 /// <param name="receiveListener">ReceiveListener</param>
 /// <param name="blinkListener">BlinkListener</param>
 /// <returns>BlinkConn</returns>
 public static BlinkConn NewConnection(
     Socket socket,
     String resourcePath,
     String fileMark,
     float progressPrecision,
     ReceiveListener receiveListener,
     BlinkListener blinkListener)
 {
     return(NewConnection(socket, DEFAULT_SOCKET_BUFFER_SIZE, resourcePath, fileMark, progressPrecision, receiveListener, blinkListener));
 }
Exemplo n.º 10
0
        /// <summary>
        /// Destroy the event
        /// </summary>
        public void Dispose()
        {
            mBlinkListener = null;
            Action action = null;

            while (mQueue.TryDequeue(out action))
            {
                action -= action;
            }
        }
Exemplo n.º 11
0
 /// <summary>
 /// Create a Bink connection by socket
 /// </summary>
 /// <param name="socket">Socket</param>
 /// <param name="resourcePath">File Resource Path</param>
 /// <param name="fileMark">File name mark to clear and create</param>
 /// <param name="progressPrecision">Send and Receive notify progress precision</param>
 /// <param name="receiveListener">ReceiveListener</param>
 /// <param name="blinkListener">BlinkListener</param>
 /// <returns>BlinkConn</returns>
 public static BlinkConn NewConnection(
     Socket socket,
     String resourcePath,
     String fileMark,
     float progressPrecision,
     ReceiveListener receiveListener,
     BlinkListener blinkListener)
 {
     return NewConnection(socket, DEFAULT_SOCKET_BUFFER_SIZE, resourcePath, fileMark, progressPrecision, receiveListener, blinkListener);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Create a Bink connection by socket
 /// </summary>
 /// <param name="socket">Socket</param>
 /// <param name="socketBufferSize">Socket BufferSize</param>
 /// <param name="resourcePath">File Resource Path</param>
 /// <param name="fileMark">File name mark to clear and create</param>
 /// <param name="progressPrecision">Send and Receive notify progress precision</param>
 /// <param name="receiveListener">ReceiveListener</param>
 /// <param name="blinkListener">BlinkListener</param>
 /// <returns>BlinkConn</returns>
 public static BlinkConn NewConnection(
     Socket socket,
     int socketBufferSize,
     String resourcePath,
     String fileMark,
     float progressPrecision,
     ReceiveListener receiveListener,
     BlinkListener blinkListener)
 {
     String path = Path.Combine(resourcePath, DEFAULT_RESOURCE_DIR);
     DiskResource resource = new DiskResource(path, fileMark);
     BlinkParserImpl parser = new BlinkParserImpl(resource);
     AsyncSocketAdapter socketAdapter = new AsyncSocketAdapter(socket, socketBufferSize);
     DelegateDelivery delivery = new DelegateDelivery(blinkListener, receiveListener);
     return new BlinkConn(socketAdapter, socketAdapter, delivery, delivery, delivery, resource, parser, progressPrecision);
 }
Exemplo n.º 13
0
        /// <summary>
        /// Create a Bink connection by socket
        /// </summary>
        /// <param name="socket">Socket</param>
        /// <param name="socketBufferSize">Socket BufferSize</param>
        /// <param name="resourcePath">File Resource Path</param>
        /// <param name="fileMark">File name mark to clear and create</param>
        /// <param name="progressPrecision">Send and Receive notify progress precision</param>
        /// <param name="receiveListener">ReceiveListener</param>
        /// <param name="blinkListener">BlinkListener</param>
        /// <returns>BlinkConn</returns>
        public static BlinkConn NewConnection(
            Socket socket,
            int socketBufferSize,
            String resourcePath,
            String fileMark,
            float progressPrecision,
            ReceiveListener receiveListener,
            BlinkListener blinkListener)
        {
            String             path          = Path.Combine(resourcePath, DEFAULT_RESOURCE_DIR);
            DiskResource       resource      = new DiskResource(path, fileMark);
            BlinkParserImpl    parser        = new BlinkParserImpl(resource);
            AsyncSocketAdapter socketAdapter = new AsyncSocketAdapter(socket, socketBufferSize);
            DelegateDelivery   delivery      = new DelegateDelivery(blinkListener, receiveListener);

            return(new BlinkConn(socketAdapter, socketAdapter, delivery, delivery, delivery, resource, parser, progressPrecision));
        }
Exemplo n.º 14
0
 public void Run()
 {
     if (listener != null)
     {
         if (status != null)
         {
             listener.OnReceiveProgress(entity.GetType(), entity.GetId(), status.total, status.cur);
         }
         else if (isEnd)
         {
             listener.OnReceiveEnd(entity);
         }
         else
         {
             listener.OnReceiveStart(entity.GetType(), entity.GetId());
         }
     }
     entity   = null;
     status   = null;
     listener = null;
 }
Exemplo n.º 15
0
 void OnEnable()
 {
     if (subscriptionsController == null)
     {
         return;
     }
     if (cameraTransform == null)
     {
         enabled = false;
         return;
     }
     if (gazeListener == null)
     {
         gazeListener = new GazeListener(subscriptionsController);
     }
     if (blinkListener == null)
     {
         blinkListener = new BlinkListener(subscriptionsController);
     }
     gazeListener.OnReceive3dGaze  += Receive3dGaze;
     blinkListener.OnBlinkDetected += BlinkDetected;
     isGazing = true;
 }
Exemplo n.º 16
0
 public DelegateDelivery(BlinkListener blinkListener, ReceiveListener receiveListener)
 {
     mBlinkListener = blinkListener;
     mReceiveListener = receiveListener;
 }
Exemplo n.º 17
0
 public DelegateDelivery(BlinkListener blinkListener, ReceiveListener receiveListener)
 {
     mBlinkListener   = blinkListener;
     mReceiveListener = receiveListener;
 }
Exemplo n.º 18
0
 /// <summary>
 /// Destroy the event
 /// </summary>
 public void Dispose()
 {
     mBlinkListener = null;
     mBlinkPoster  -= ExecutorDelivery_BlinkPoster;
     mSendPoster   -= ExecutorDelivery_SendPoster;
 }
Exemplo n.º 19
0
 public BlinkDeliveryRunnable(BlinkListener listener)
 {
     this.listener = listener;
 }
Exemplo n.º 20
0
 /**
  * Create a Bink connection by socket
  *
  * @param socket           Socket
  * @param socketBufferSize Socket BufferSize
  * @param resourcePath     File Resource Path
  * @param executor         Executor to notify callback
  * @param listener         ReceiveListener
  * @return BlinkConn
  * @throws Exception
  */
 public static BlinkConn newConnection(Socket socket, int socketBufferSize, String resourcePath, Executor executor, BlinkListener listener)
 {
     return(newConnection(socket, socketBufferSize, resourcePath, new Guid().ToString(), executor, listener));
 }
Exemplo n.º 21
0
 /**
  * Create a Bink connection by socket
  *
  * @param socket       Socket
  * @param resourcePath File Resource Path
  * @param executor     Executor to notify callback
  * @param listener     ReceiveListener
  * @return BlinkConn
  * @throws Exception
  */
 public static BlinkConn newConnection(Socket socket, String resourcePath, Executor executor, BlinkListener listener)
 {
     return(newConnection(socket, DEFAULT_SOCKET_BUFFER_SIZE, resourcePath, new Guid().ToString(), executor, listener));
 }
Exemplo n.º 22
0
 /**
  * Create a Bink connection by socket with SingleThreadExecutor callback
  *
  * @param socket   Socket
  * @param listener ReceiveListener
  * @return BlinkConn
  * @throws Exception
  */
 public static BlinkConn newConnection(Socket socket, BlinkListener listener)
 {
     return(newConnection(socket, DEFAULT_SOCKET_BUFFER_SIZE, getDefaultResourcePath(), new Guid().ToString(), new SingleExecutor(), listener));
 }
Exemplo n.º 23
0
        /**
         * Create a Bink connection by socket
         *
         * @param socket           Socket
         * @param socketBufferSize Socket BufferSize
         * @param resourcePath     File Resource Path
         * @param fileMark         File name mark to clear
         * @param executor         Executor to notify callback
         * @param listener         ReceiveListener
         * @return BlinkConn
         * @throws Exception
         */
        public static BlinkConn newConnection(Socket socket, int socketBufferSize, String resourcePath, String fileMark, Executor executor, BlinkListener listener)
        {
            String           path          = Path.Combine(resourcePath, DEFAULT_RESOURCE_DIR);
            DiskResource     resource      = new DiskResource(path, fileMark);
            BlinkParser      parser        = new BlinkParser(resource);
            SocketAdapter    socketAdapter = new SocketAdapter(socket, socketBufferSize, parser);
            ExecutorDelivery delivery      = new ExecutorDelivery(executor, listener);

            return(new BlinkConn(socketAdapter, delivery, socketAdapter, delivery, resource));
        }
Exemplo n.º 24
0
 /// <summary>
 /// Create a Bink connection by socket
 /// </summary>
 /// <param name="socket">Socket</param>
 /// <param name="resourcePath">File Resource Path</param>
 /// <param name="receiveListener">ReceiveListener</param>
 /// <param name="blinkListener">BlinkListener</param>
 /// <returns>BlinkConn</returns>
 public static BlinkConn NewConnection(Socket socket, String resourcePath, ReceiveListener receiveListener, BlinkListener blinkListener)
 {
     return(NewConnection(socket, DEFAULT_SOCKET_BUFFER_SIZE, resourcePath, Guid.NewGuid().ToString(), DEFAULT_PROGRESS_PRECISION, receiveListener, blinkListener));
 }
Exemplo n.º 25
0
 /// <summary>
 /// Create a Bink connection by socket
 /// </summary>
 /// <param name="socket">Socket</param>
 /// <param name="resourcePath">File Resource Path</param>
 /// <param name="progressPrecision">Send and Receive notify progress precision</param>
 /// <param name="receiveListener">ReceiveListener</param>
 /// <param name="blinkListener">BlinkListener</param>
 /// <returns>BlinkConn</returns>
 public static BlinkConn NewConnection(
     Socket socket,
     int socketBufferSize,
     String resourcePath,
     float progressPrecision,
     ReceiveListener receiveListener,
     BlinkListener blinkListener)
 {
     return NewConnection(socket, socketBufferSize, resourcePath, Guid.NewGuid().ToString(), progressPrecision, receiveListener, blinkListener);
 }
Exemplo n.º 26
0
 /// <summary>
 /// Destroy the event
 /// </summary>
 public void Dispose()
 {
     mBlinkListener = null;
     mBlinkPoster -= ExecutorDelivery_BlinkPoster;
     mSendPoster -= ExecutorDelivery_SendPoster;
 }
Exemplo n.º 27
0
 public CallBackDelivery(BlinkListener blinkListener, ReceiveListener receiveListener)
 {
     mBlinkListener   = blinkListener;
     mReceiveListener = receiveListener;
 }
Exemplo n.º 28
0
 public CallBackDelivery(BlinkListener blinkListener, ReceiveListener receiveListener)
 {
     mBlinkListener = blinkListener;
     mReceiveListener = receiveListener;
 }
Exemplo n.º 29
0
 public BlinkDeliveryRunnable(BlinkListener listener)
 {
     this.listener = listener;
 }
Exemplo n.º 30
0
 public ExecutorDelivery(Executor executor, BlinkListener listener)
 {
     mPoster   = executor;
     mListener = listener;
 }
Exemplo n.º 31
0
 public void Run()
 {
     if (listener != null)
     {
         listener.OnBlinkDisconnect();
         listener = null;
     }
 }
Exemplo n.º 32
0
 /// <summary>
 /// Create a Bink connection by socket
 /// </summary>
 /// <param name="socket">Socket</param>
 /// <param name="receiveListener">ReceiveListener</param>
 /// <param name="blinkListener">BlinkListener</param>
 /// <returns>BlinkConn</returns>
 public static BlinkConn NewConnection(Socket socket, ReceiveListener receiveListener, BlinkListener blinkListener)
 {
     return NewConnection(socket, DEFAULT_SOCKET_BUFFER_SIZE, GetDefaultResourcePath(), Guid.NewGuid().ToString(), DEFAULT_PROGRESS_PRECISION, receiveListener, blinkListener);
 }
Exemplo n.º 33
0
 /// <summary>
 /// Destroy the event
 /// </summary>
 public void Dispose()
 {
     mBlinkListener = null;
     mReceiveListener = null;
     mQueue.Clear();
 }
Exemplo n.º 34
0
 /// <summary>
 /// Destroy the event
 /// </summary>
 public void Dispose()
 {
     mBlinkListener   = null;
     mReceiveListener = null;
     mQueue.Clear();
 }