package hh.dejsem.net;

import android.os.AsyncTask;

import hh.dejsem.K;
import hh.lib.D;

class NetThread extends AsyncTask<SrvCmd, String, Void> {
	D d;
	SrvCmd action;
	Exception exception;

	NetThread(D d) { this.d = d.klon(this); }

	NetThread(D d, SrvCmd action) {
		this(d);
		this.action = action;
		if(d.ll(4)) this.d.l("initFromContext, action=" + action);
	}

	@Override
	protected Void doInBackground(SrvCmd... actions) {
		if(d.ll(4)) this.d.l("doInBackground starting...");
		exception = null;
		try {
			if(K.netNode == null) K.netNode = new NetNode(d);
			if(K.cmdConn == null) K.cmdConn = new NetConnSrv(d);
		}
		catch(Exception e) {}
		finally { return null; }
	}
}
