stopClients() public static method

public static stopClients ( ) : bool
return bool
Ejemplo n.º 1
0
    public IEnumerator stopClientAndServer()
    {
                #if UNITY_ANDROID && !UNITY_EDITOR
        //Stop Threads
        for (int i = 0; i < Config.bufferClientThreadList.Length; i++)
        {
            string clientname = Config.bufferClientThreadList[i];
            logStatus(clientname + "\nstoppen");
            FieldtripServicesControlerInterface.stopThread(clientname);
            yield return(new WaitForSeconds(1));                    //These waits are for the Services to have time to pass around their intents.
        }
                #endif

        //Stop buffer
        logStatus("Buffer stoppen...");
        if (bufferIsOn)
        {
            buffer.disconnect();
            bufferIsOn = false;
        }
        yield return(new WaitForSeconds(1));

                #if UNITY_ANDROID && !UNITY_EDITOR
        //Stop Clients
        logStatus("Client stoppen...");
        Debug.Log("Stopped: " + FieldtripServicesControlerInterface.stopClients());
        yield return(new WaitForSeconds(2));

        //Stop Server
        logStatus("Server stoppen...");
        Debug.Log("Stopped: " + FieldtripServicesControlerInterface.stopServer());
        yield return(new WaitForSeconds(2));
        #endif

        //Update Status
        systemIsReady = false;         //signals Unity it is safe to close down as well
        logStatus("Systeem offline");
    }
Ejemplo n.º 2
0
	public IEnumerator stopClientAndServer(){
		systemIsReady = false;
		#if !NOSERVICESCONTROLLER && UNITY_ANDROID && !UNITY_EDITOR
			//Stop Clients
			clientIsConnected = false;
			logStatus ("stopping classifier...");
			FieldtripServicesControlerInterface.stopThread (ccThreadID);
			yield return new WaitForSeconds (1);
			logStatus ("stopping muse...");
			FieldtripServicesControlerInterface.stopThread (museThreadID);
			yield return new WaitForSeconds (1);
			logStatus ("shutting down clients...");
			Debug.Log ("Stopped Clients = " + FieldtripServicesControlerInterface.stopClients ());
			yield return new WaitForSeconds (1);
		#endif

		//Stop buffer
		logStatus ("removing buffer...");
		if ( bufferIsOn ){
			buffer.disconnect ();
			bufferIsOn = false;
		}
		yield return new WaitForSeconds (1);

		#if !NOSERVICESCONTROLLER && UNITY_ANDROID && !UNITY_EDITOR
			//Stop Server
			logStatus ("shutting down server...");
			updateServer = false;
			Debug.Log ("Stopped Server = " + FieldtripServicesControlerInterface.stopServer ());
			yield return new WaitForSeconds (1);

      #endif
		//Update Status
		clientIsConnected = false;
		logStatus ("system offline");
		resetStatus ();
	}