msg.setChannelId(chanId++);
msg.setChannelType("session");
msg.setInitialWindowSize(DEFAULT_WIN_INIT_SIZE);
msg.setMaxPacketSize(DEFAULT_PACKET_MAX_SIZE);
transport.writeMessage(msg);
ChannelOpenConfirmationMessage conf = null;
try {
conf = (ChannelOpenConfirmationMessage)queue.take();
} catch (InterruptedException ie) {
ie.printStackTrace();
throw new SSHException("Unexpected error", ie);
}
SSHChannel chann = new SSHChannel(conf.getRecipientChannelId(),
conf.getSenderChannelId(), DEFAULT_WIN_INIT_SIZE,
conf.getInitialWindowSize(), conf.getMaxPacketSize(),
this);
locals.put(conf.getRecipientChannelId(), chann);
remotes.put(conf.getSenderChannelId(), chann);
return chann;
}