changeset 10:e40c010c703b

*** empty log message ***
author pin
date Sun, 22 Oct 2006 23:28:05 +0900
parents ff7e7833cded
children b3cff9bd2cbc
files bin/remoteeditor/network/REP.class src/remoteeditor/network/REP.java
diffstat 2 files changed, 2 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
Binary file bin/remoteeditor/network/REP.class has changed
--- a/src/remoteeditor/network/REP.java	Sun Oct 22 20:36:30 2006 +0900
+++ b/src/remoteeditor/network/REP.java	Sun Oct 22 23:28:05 2006 +0900
@@ -103,14 +103,11 @@
 	public void insert(int offset, int length, String text) throws IOException {
 		seqid = (byte)offset;
 		sc.write(pack(buffer, REP_INSERT_CMD, sid, eid, seqid, lineno, text));
-		//unpack();
-		//System.out.println("read packet:" + cmd +", "+ sid +", "+ eid +", "+ seqid +", "+ lineno +", "+ textsiz +", "+ string);
 	}
 	
     public ByteBuffer pack(ByteBuffer buffer,int cmd, int sid, int eid, int seqid, int lineno, String text ) {	
 
 
-    	//System.out.println("pack:" + cmd +", "+ sid +", "+ eid +", "+ seqid +", "+ lineno);
     	
     	//ByteBuffer buffer = ByteBuffer.allocateDirect(24+textsiz);
     	buffer.clear();  // position = 0 
@@ -178,36 +175,15 @@
 	}
 
 	public void run() {
-		// TODO Auto-generated method stub
 		while(sc.isConnected()){
-			//buffer.clear();
-			//try {
-			//	sc.read(buffer);
-			//} catch (IOException e) {
-				// TODO Auto-generated catch block
-			//	e.printStackTrace();
-			//}
-			//buffer.flip();
-			//for(int i = 0; i < 24; i++){
-			//	readbyte[i] = buffer.get();
-				//System.out.println(readbyte[i]);
-			//}
-			//cmd = readbyte[3];
-			//sid = readbyte[7];
-			//eid = readbyte[11];
-			//textsiz = readbyte[23];
-			//for(int i = 0; i < textsiz; i++){
-			//	readbyte[i] = buffer.get();
-			//}
-			//string = new String(readbyte, 0, textsiz);
+
 			try {
 				unpack(buffer);
 			} catch (IOException e) {
-				// TODO Auto-generated catch block
 				e.printStackTrace();
 			}
 			System.out.println("read packet:" + cmd +", "+ sid +", "+ eid +", "+ seqid +", "+ lineno +", "+ textsiz +", "+ string);
-			socketListener.packetReceived(new RSocketEvent(seqid, textsiz, string));
+			socketListener.packetReceived(new RSocketEvent(lineno, textsiz, string));
 		}	
 		
 	}
@@ -216,10 +192,7 @@
 		try {
 			sc.close();
 		} catch (IOException e) {
-			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
-		// TODO Auto-generated method stub
-		
 	}
 }