Package org.apache.sshd.server

Examples of org.apache.sshd.server.ServerChannel


            buffer.putString("");
            writePacket(buffer);
            return;
        }

        ServerChannel channel = null;
        for (NamedFactory<ServerChannel> factory : getServerFactoryManager().getChannelFactories()) {
            if (factory.getName().equals(type)) {
                channel = factory.create();
                break;
            }
        }
        if (channel == null) {
            buffer = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_FAILURE);
            buffer.putInt(id);
            buffer.putInt(SshConstants.SSH_OPEN_UNKNOWN_CHANNEL_TYPE);
            buffer.putString("Unsupported channel type: " + type);
            buffer.putString("");
            writePacket(buffer);
            return;
        }

        int channelId;
        synchronized (channels) {
            channelId = nextChannelId++;
        }
        channels.put(channelId, channel);
        channel.init(this, channelId, id, rwsize, rmpsize);
        buffer = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_CONFIRMATION);
        buffer.putInt(id);
        buffer.putInt(channelId);
        buffer.putInt(channel.getLocalWindow().getSize());
        buffer.putInt(channel.getLocalWindow().getPacketSize());
        writePacket(buffer);
    }
View Full Code Here


            buffer.putString("");
            writePacket(buffer);
            return;
        }

        ServerChannel channel = null;
        for (NamedFactory<ServerChannel> factory : getServerFactoryManager().getChannelFactories()) {
            if (factory.getName().equals(type)) {
                channel = factory.create();
                break;
            }
        }
        if (channel == null) {
            buffer = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_FAILURE);
            buffer.putInt(id);
            buffer.putInt(SshConstants.SSH_OPEN_UNKNOWN_CHANNEL_TYPE);
            buffer.putString("Unsupported channel type: " + type);
            buffer.putString("");
            writePacket(buffer);
            return;
        }

        int channelId;
        synchronized (channels) {
            channelId = nextChannelId++;
        }
        channels.put(channelId, channel);
        channel.init(this, channelId, id, rwsize, rmpsize);
        buffer = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_CONFIRMATION);
        buffer.putInt(id);
        buffer.putInt(channelId);
        buffer.putInt(channel.getLocalWindow().getSize());
        buffer.putInt(channel.getLocalWindow().getPacketSize());
        writePacket(buffer);
    }
View Full Code Here

TOP

Related Classes of org.apache.sshd.server.ServerChannel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.