public void run() {
		  int th = 0;
		  while (true)
		  {
			   String message;
			   try
			   {
					message = mMessages.take();
			   }
			   catch (InterruptedException ex)
			   {
					break;
			   }

			   if (message.equals("end-connection"))
			   {
					try
					{
						 mConn.close();
					}
					catch(Exception ex)
					{
					}
					break;
			   }

			   try
			   {
					mOutput.write(message);
					mOutput.newLine();
					++ th;
					if (mMessages.peek() == null || th > 50)
					{
						 mOutput.flush();
						 th = 0;
					}
			   }
			   catch (IOException ex)
			   {
					try
					{
						 mConn.close();
					}
					catch(Exception exx)
					{
					}
					break;
			   }
		  }
	 }