Back to project page msghandle.
The source code is released under:
GNU General Public License
If you think the Android project msghandle listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.anlong.msghandle.message; // w w w . jav a 2 s .c o m import java.io.InputStream; import com.anlong.msghandle.common.HandleStaticValue; import com.anlong.msghandle.handle.MsgResponseHandle; import com.anlong.msghandle.socket.InitMsgSocketServer; import com.anlong.msghandle.util.IMLog; import com.anlong.msghandle.util.Utils; /** * @Title: InitRespMessageServer.java * @Package com.anlong.msghandle.message * @company ShenZhen AnLong Technology CO.,LTD. * @author lixl * @date 2014-3-12 ????5:17:34 * @version V1.0 * @Description: ???????????????? */ public class InitRespMessageServer implements Runnable { public InitRespMessageServer(){} @Override public void run() { InputStream inputStream = null; MsgResponseHandle msgResponseHandle=new MsgResponseHandle(); //??Socket??????????? while(InitMsgSocketServer.getInstance() != null){ try { // ????0.5? Thread.sleep(500); // TODO ??Socket???? if (InitMsgSocketServer.getInstance().isConnected()){ // TODO ????IO???????? if (inputStream == null) { inputStream = InitMsgSocketServer.getInputStream(); } //???????????? if(msgResponseHandle==null){ msgResponseHandle=new MsgResponseHandle(); } msgResponseHandle.decode(inputStream); } else { // TODO ????,???? IMLog.anlong("Socket???????,???????????."); Utils.notifyMessage(3,HandleStaticValue.BCODE1000); break; } } catch (Exception e){ e.printStackTrace(); IMLog.anlong("????IO???,????????????"); // TODO ???????????? Utils.notifyMessage(3,HandleStaticValue.BCODE1000); break; } } IMLog.anlong("===================================================(???????)????========================================================="); } }