Mercurial > hg > RemoteEditor > Eclipse
comparison src/remoteeditor/network/REP.java @ 31:ebbc14dd1a1a
*** empty log message ***
author | pin |
---|---|
date | Tue, 16 Jan 2007 13:55:38 +0900 |
parents | 5723cfd85c95 |
children | 86e04721e463 |
comparison
equal
deleted
inserted
replaced
30:5723cfd85c95 | 31:ebbc14dd1a1a |
---|---|
19 public class REP implements Runnable{ | 19 public class REP implements Runnable{ |
20 | 20 |
21 SocketChannel sc; | 21 SocketChannel sc; |
22 int cmd; | 22 int cmd; |
23 int eid; | 23 int eid; |
24 int eid2; | |
24 int lineno; | 25 int lineno; |
25 int sid; | 26 int sid; |
26 int seqid; | 27 int seqid; |
27 int textsiz; | 28 int textsiz; |
28 | 29 |
100 } | 101 } |
101 | 102 |
102 public void join() { | 103 public void join() { |
103 rWrite(pack( REP_JOIN_CMD, sid, eid, seqid, lineno, "afro")); | 104 rWrite(pack( REP_JOIN_CMD, sid, eid, seqid, lineno, "afro")); |
104 unpack(); | 105 unpack(); |
106 eid2 = eid; | |
105 System.out.println("read packet:" + cmd +", "+ sid +", "+ eid +", "+ seqid +", "+ lineno +", "+ textsiz +", "+ string); | 107 System.out.println("read packet:" + cmd +", "+ sid +", "+ eid +", "+ seqid +", "+ lineno +", "+ textsiz +", "+ string); |
106 } | 108 } |
107 | 109 |
108 public void put() { | 110 public void put() { |
109 rWrite(pack(REP_PUT_CMD, sid, eid, seqid, lineno, filename)); | 111 rWrite(pack(REP_PUT_CMD, sid, eid, seqid, lineno, filename)); |
193 //System.out.println(readbyte[i]); | 195 //System.out.println(readbyte[i]); |
194 }*/ | 196 }*/ |
195 String text = ""; | 197 String text = ""; |
196 cmd = header.getInt(); | 198 cmd = header.getInt(); |
197 sid = header.getInt(); | 199 sid = header.getInt(); |
198 int eid2 = header.getInt(); | 200 eid = header.getInt(); |
199 seqid = header.getInt(); | 201 seqid = header.getInt(); |
200 lineno = header.getInt(); | 202 lineno = header.getInt(); |
201 textsiz = header.getInt()/2; | 203 textsiz = header.getInt()/2; |
202 | 204 |
203 ByteBuffer textBuffer = ByteBuffer.allocateDirect(textsiz*2); | 205 ByteBuffer textBuffer = ByteBuffer.allocateDirect(textsiz*2); |
261 } catch (IOException e) { | 263 } catch (IOException e) { |
262 e.printStackTrace(); | 264 e.printStackTrace(); |
263 } | 265 } |
264 } | 266 } |
265 | 267 |
266 public synchronized void sendCmd(int cmd2, int line, int length, String lineText) { | 268 public void sendCmd(int cmd2, int line, int length, String lineText) { |
267 //cmd = REP_INSERT_CMD; | 269 //cmd = REP_INSERT_CMD; |
268 //rWrite(pack(cmd2, sid, eid, seqid, line, lineText)); | 270 //rWrite(pack(cmd2, sid, eid, seqid, line, lineText)); |
269 try { | 271 try { |
270 myCmdList.add(new Rep_Cmd(cmd2, sid, eid, seqid, line, length, lineText)); | 272 myCmdList.add(new Rep_Cmd(cmd2, sid, eid, seqid, line, length, lineText)); |
271 //System.out.println("myCmdList : " + myCmdList.toString()); | 273 //System.out.println("myCmdList : " + myCmdList.toString()); |