view rep/EditorChannel.java @ 9:2d4c2c19d2d0

*** empty log message ***
author pin
date Tue, 30 Oct 2007 15:52:02 +0900
parents
children 167694db4796
line wrap: on
line source

package rep;

import java.nio.channels.SocketChannel;
import java.nio.channels.spi.SelectorProvider;

public abstract class EditorChannel extends SocketChannel {

	protected EditorChannel(SelectorProvider provider) {
		super(provider);
	}

	private REPPacketSend repsend;
	private REPPacketReceive reprec;
	
	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);
	}

}