Mercurial > hg > Applications > TreeVNC
view src/main/java/jp/ac/u_ryukyu/treevnc/AcceptThread.java @ 35:1b81deb0abb3
write a little part reconnection.
author | one |
---|---|
date | Wed, 12 Sep 2012 13:16:47 +0900 |
parents | f70008073a03 |
children | c2f0b6907448 |
line wrap: on
line source
package jp.ac.u_ryukyu.treevnc; import java.net.Socket; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import com.glavsoft.transport.Reader; import com.glavsoft.transport.Writer; public class AcceptThread implements Runnable { MyRfbProto rfb = null; byte[] imageBytes; int port; public AcceptThread(MyRfbProto _rfb) { rfb = _rfb; } public AcceptThread(MyRfbProto _rfb, int p) { rfb = _rfb; port = p; } public void changeRfb(MyRfbProto _rfb) { rfb = _rfb; } public void run() { rfb.selectPort(port); while (true) { try { Socket newCli = rfb.accept(); OutputStream os = newCli.getOutputStream(); InputStream is = newCli.getInputStream(); rfb.newClient(this, newCli, new Writer(os), new Reader(is)); } catch (IOException e) { e.printStackTrace(); System.out.println(e); } } } }