예제 #1
0
        public IConnection createConnection(IConnectionStateListener k = null)
        {
            IConnection _local_2 = new SocketConnection(this, k);

            this._connections.Add(_local_2);
            return(_local_2);
        }
예제 #2
0
 public SocketConnection(ICoreCommunicationManager communicationManager, IConnectionStateListener stateListener)
 {
     this._communicationManager = communicationManager;
     this._messageClassManager  = new MessageClassManager();
     ///this._wireFormat = new EvaWireFormat();
     this.createSocket();
     ///this._timeOutTimer = new Timer(DEFAULT_SOCKET_TIMEOUT, 1);
     /// this._timeOutTimer.addEventListener(TimerEvent.TIMER, this.onTimeOutTimer);
     this._stateListener = stateListener;
 }
예제 #3
0
        /// <summary>
        /// Remove a <see cref="TETCSharpClient.IConnectionStateListener"/> from the TET C# client.
        /// </summary>
        /// <returns>True if succesfully removed, false otherwise</returns>
        /// <param name="listener">The <see cref="TETCSharpClient.IConnectionStateListener"/> instance to remove</param>
        public bool RemoveConnectionStateListener(IConnectionStateListener listener)
        {
            bool result = false;

            if (null != listener)
            {
                if (connectionStateListeners.Contains(listener))
                    result = connectionStateListeners.Remove(listener);
            }

            return result;
        }
예제 #4
0
        /// <summary>
        /// Checkes if a given instance of <see cref="TETCSharpClient.IConnectionStateListener"/> is currently attached.
        /// </summary>
        /// <returns>True if already attached, false otherwise</returns>
        public bool HasConnectionStateListener(IConnectionStateListener listener)
        {
            bool result = false;

            if (null != listener)
            {
                result = connectionStateListeners.Contains(listener);
            }

            return result;
        }
예제 #5
0
 /// <summary>
 /// Adds a <see cref="TETCSharpClient.IConnectionStateListener"/> to the TET C# client. This listener 
 /// will recieve updates about change in connection state to the EyeTribe Server.
 /// </summary>
 /// <param name="listener">The <see cref="TETCSharpClient.IConnectionStateListener"/> instance to add</param>
 public void AddConnectionStateListener(IConnectionStateListener listener)
 {
     if (null != listener)
     {
         if (!connectionStateListeners.Contains(listener))
             connectionStateListeners.Add(listener);
     }
 }
예제 #6
0
 /// <summary>
 /// Activates TET C# Client and all underlying routines. Should be called _only_ 
 /// once when an application starts up. Calling thread will be locked during
 /// initialization.
 /// </summary>
 /// <param name="apiVersion">Version number of the Tracker API that this client will be compliant to</param>
 /// <param name="mode">Mode though which the client will receive GazeData. Either ClientMode.Push or ClientMode.Pull</param>
 /// <param name="hostname">The host name or IP address where the eye tracking server is running.</param>
 /// <param name="portnumber">The port number used for the eye tracking server</param>
 /// <param name="listener">Listener to notify once the connection to EyeTribe Server has been established</param> 
 /// <returns>True if succesfully activated, false otherwise</returns>
 public bool Activate(ApiVersion apiVersion, ClientMode mode, string hostname, int portnumber, IConnectionStateListener listener)
 {
     AddConnectionStateListener(listener);
     return Activate(apiVersion, mode, hostname, portnumber, listener);
 }
예제 #7
0
 /// <summary>
 /// Activates TET C# Client and all underlying routines using default values. Should be called _only_ 
 /// once when an application starts up. Calling thread will be locked during
 /// initialization.
 /// </summary>
 /// <param name="apiVersion">Version number of the Tracker API that this client will be compliant to</param>
 /// <param name="mode">Mode though which the client will receive GazeData. Either ClientMode.Push or ClientMode.Pull</param>
 /// <param name="listener">Listener to notify once the connection to EyeTribe Server has been established</param>
 /// <returns>True if succesfully activated, false otherwise</returns>
 public bool Activate(ApiVersion apiVersion, ClientMode mode, IConnectionStateListener listener)
 {
     AddConnectionStateListener(listener);
     return Activate(apiVersion, mode, GazeApiManager.DEFAULT_SERVER_HOST, GazeApiManager.DEFAULT_SERVER_PORT);
 }
예제 #8
0
 public SocketConnection(ICoreCommunicationManager communicationManager, IConnectionStateListener stateListener)
 {
 }