Mercurial > hg > Applications > TreeVNC
view src/main/java/ac/ryukyu/treevnc/server/AcceptThread.java @ 11:57ae9fbb1245
add files
author | Taninari YU <you@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 21 Aug 2012 14:02:05 +0900 |
parents | |
children |
line wrap: on
line source
package ac.ryukyu.treevnc.server; import java.net.Socket; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class AcceptThread implements Runnable { MyRfbProto rfb = null; byte[] imageBytes; int port; AcceptThread(MyRfbProto _rfb) { rfb = _rfb; } 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, os, is); } catch (IOException e) { e.printStackTrace(); System.out.println(e); } } } }