Package com.maverick.multiplex

Examples of com.maverick.multiplex.SocketChannel


    class SocketChannelFactory implements ChannelFactory {

            public Channel createChannel(MultiplexedConnection connection, String type) {
             
              if(type.equals(SocketChannel.CHANNEL_TYPE))
                    return new SocketChannel();
              else
                return null;
            }
View Full Code Here


     
    Socket socket = new Socket("127.0.0.1", 10000);

    MultiplexedConnection c = new MultiplexedConnection(null);

    SocketChannel channel = new SocketChannel(socket, "cvs.3sp.co.uk", 22);

    c.openChannel(channel);

    channel.getOutputStream().write("SSH-2.0-foobar\r\n".getBytes());

    byte[] id = new byte[255];

    int read = channel.getInputStream().read(id);

    System.out.write(id, 0, read);

    } catch(Throwable t) {
      t.printStackTrace();
View Full Code Here

TOP

Related Classes of com.maverick.multiplex.SocketChannel

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.