comparison src/MyRfbProto.java @ 17:4eda2dbb7fef

ProxyVncCanvas version 0.2
author e085711
date Sun, 17 Apr 2011 23:59:13 +0900
parents 89e1c5f84407
children ccad9909e0e2
comparison
equal deleted inserted replaced
16:549229fd7288 17:4eda2dbb7fef
101 101
102 void sendInitData(Socket sock) throws IOException{ 102 void sendInitData(Socket sock) throws IOException{
103 sock.getOutputStream().write(initData); 103 sock.getOutputStream().write(initData);
104 } 104 }
105 105
106 void sendData(byte b[]) throws IOException{ 106 // void sendData(byte b[]) throws IOException{
107 for(Socket cli : cliList) 107 void sendData(byte b[]){
108 cli.getOutputStream().write(b, 0, b.length); 108 try{
109 for(Socket cli : cliList){
110 try{
111 cli.getOutputStream().write(b, 0, b.length);
112 }catch(IOException e){
113 // if socket closed
114 // cliList.remove(cli);
115 cliList.remove(cli);
116 System.out.println("cliSize="+cliSize());
117 }
118 }
119 }catch(Exception e){
120 System.out.println("cliSize 0");
121 }
109 } 122 }
110 boolean ready() throws IOException { 123 boolean ready() throws IOException {
111 BufferedReader br = new BufferedReader(new InputStreamReader(is)); 124 BufferedReader br = new BufferedReader(new InputStreamReader(is));
112 return br.ready(); 125 return br.ready();
113 } 126 }