annotate rep/EditorChannel.java @ 84:54334d83194a

*** empty log message ***
author pin
date Fri, 21 Dec 2007 16:03:04 +0900
parents 167694db4796
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
1 package rep;
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
2
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
3 import java.nio.channels.SocketChannel;
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
4 import java.nio.channels.spi.SelectorProvider;
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
5
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
6 public abstract class EditorChannel extends SocketChannel {
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
7
11
167694db4796 *** empty log message ***
pin
parents: 9
diff changeset
8 private REPPacketSend repsend;
167694db4796 *** empty log message ***
pin
parents: 9
diff changeset
9 private REPPacketReceive reprec;
167694db4796 *** empty log message ***
pin
parents: 9
diff changeset
10
9
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
11 protected EditorChannel(SelectorProvider provider) {
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
12 super(provider);
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
13 }
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
14
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
15 public void putPacket(REPCommand comm){
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
16 repsend.send(comm);
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
17 }
11
167694db4796 *** empty log message ***
pin
parents: 9
diff changeset
18
9
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
19 public REPCommand getPacket(){
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
20 REPCommand command = reprec.unpack();
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
21 return command;
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
22 }
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
23
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
24 public void setIO(SocketChannel channel) {
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
25 repsend = new REPPacketSend(channel);
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
26 reprec = new REPPacketReceive(channel);
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
27 }
11
167694db4796 *** empty log message ***
pin
parents: 9
diff changeset
28
167694db4796 *** empty log message ***
pin
parents: 9
diff changeset
29 public void setIO() {
167694db4796 *** empty log message ***
pin
parents: 9
diff changeset
30 repsend = new REPPacketSend(this);
167694db4796 *** empty log message ***
pin
parents: 9
diff changeset
31 reprec = new REPPacketReceive(this);
167694db4796 *** empty log message ***
pin
parents: 9
diff changeset
32 }
9
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
33
2d4c2c19d2d0 *** empty log message ***
pin
parents:
diff changeset
34 }