// Path: clients/java/src/com/example/tool/Log.java
// public class Log {
// 
// 	public static void d(String tag, String info) {
// 		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 		System.out.println("[" + df.format(new Date()) + "]" + tag + " : " + info);
// 	}
// 
// 	public static void e(String tag, String info) {
// 		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 		System.out.println("[" + df.format(new Date()) + "]" +  "* ERROR * : " + info);
// 	}
// }


import java.io.InterruptedIOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import com.avcon.conf.Config;
import com.avcon.msg.MsgDefine;
import com.avcon.tool.Log;
import com.avcon.tool.NetworkDataHelper;
	}

	public void run() {
		isRunning = true;

		while (isRun) {
			if (false == running()) {
				int i = WAIT_TIMES;

				while (0 < i-- && isRun) {
					try {
						Thread.sleep(CONNECTION_TIME_OUT);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			}
		}

		isRunning = false;
	}

	private final int sizeSize = 2; // the size of size field in header
	private ByteBuffer bufferSize = ByteBuffer.allocate(sizeSize);
	
	private ByteBuffer bufferMsg = null;
	private int offset = 0;
	private int pendingSize = 0;

	private void close() {
// Path: clients/java/src/com/example/tool/Log.java
// public class Log {
// 
// 	public static void d(String tag, String info) {
// 		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 		System.out.println("[" + df.format(new Date()) + "]" + tag + " : " + info);
// 	}
// 
// 	public static void e(String tag, String info) {
// 		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 		System.out.println("[" + df.format(new Date()) + "]" +  "* ERROR * : " + info);
// 	}
// }


// Path: clients/java/src/com/example/network/Connection.java
import java.io.InterruptedIOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import com.avcon.conf.Config;
import com.avcon.msg.MsgDefine;
import com.avcon.tool.Log;
import com.avcon.tool.NetworkDataHelper;

	}

	public void run() {
		isRunning = true;

		while (isRun) {
			if (false == running()) {
				int i = WAIT_TIMES;

				while (0 < i-- && isRun) {
					try {
						Thread.sleep(CONNECTION_TIME_OUT);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			}
		}

		isRunning = false;
	}

	private final int sizeSize = 2; // the size of size field in header
	private ByteBuffer bufferSize = ByteBuffer.allocate(sizeSize);
	
	private ByteBuffer bufferMsg = null;
	private int offset = 0;
	private int pendingSize = 0;

	private void close() {
		Log.d(Config.LOG_TAG, "Close socket");