@Override
	public void run() {
		// TODO Auto-generated method stub
		
		System.out.println("Sorter thread birth");
		while(true)
		{
			//if((sock == null) || (!sock.isConnected()))
			//{
			if(flag.get())
			{
				System.out.println("restarting all the threads yo");
				if(incThread==null)
				{
				
				}
				else if(incThread.isAlive())
				{
					incThread.interrupt();
					//incThread.stop();
				}
				if(outThread==null)
				{
				
				}
				else if(outThread.isAlive())
				{
				outThread.interrupt();
				//outThread.stop();
				}
				start_threads();
				flag.set(false);
			}
			
				/*frontend_sort();
				System.out.println("Socket connection failed in front end check....");*/
			//}else
				try {
					Thread.sleep(sortTimeout);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					System.out.println("Sorter disturbed not cool bro!");
					e.printStackTrace();
				}
				
		}//

	}