Mercurial > hg > RemoteEditor > REPSessionManager
view rep/EditorChannel.java @ 38:de8638eb0edd
*** empty log message ***
author | pin |
---|---|
date | Sat, 10 Nov 2007 18:51:09 +0900 |
parents | 167694db4796 |
children |
line wrap: on
line source
package rep; import java.nio.channels.SocketChannel; import java.nio.channels.spi.SelectorProvider; public abstract class EditorChannel extends SocketChannel { private REPPacketSend repsend; private REPPacketReceive reprec; protected EditorChannel(SelectorProvider provider) { super(provider); } public void putPacket(REPCommand comm){ repsend.send(comm); } public REPCommand getPacket(){ REPCommand command = reprec.unpack(); return command; } public void setIO(SocketChannel channel) { repsend = new REPPacketSend(channel); reprec = new REPPacketReceive(channel); } public void setIO() { repsend = new REPPacketSend(this); reprec = new REPPacketReceive(this); } }