public IConnection createConnection(IConnectionStateListener k = null)
        {
            IConnection _local_2 = new SocketConnection(this, k);

            this._connections.Add(_local_2);
            return(_local_2);
        }
Beispiel #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;
 }
Beispiel #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;
        }
Beispiel #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;
        }
Beispiel #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);
     }
 }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #8
0
 public SocketConnection(ICoreCommunicationManager communicationManager, IConnectionStateListener stateListener)
 {
 }