protected static FORK getFORK(Channel ch, int position, Class<? extends Protocol> neighbor,
boolean create_fork_if_absent) throws Exception {
ProtocolStack stack=ch.getProtocolStack();
FORK fork=(FORK)stack.findProtocol(FORK.class);
if(fork == null) {
if(!create_fork_if_absent)
throw new IllegalArgumentException("FORK not found in main stack");
fork=new FORK();
stack.insertProtocol(fork, position, neighbor);