Changed SocketThread.run (boolean) to SocketThread.run (int). To be used as a state variable with more than 2 states