Package streams

Examples of streams.StreamCommutator


        logger.debug("bot manager created");
    }

    private StreamCommutator createStreamCommutator(StreamsContainer container) {
        logger.debug("creating user-side stream commutator");
        StreamCommutator commutator = new StreamCommutator();

        commutator.addStreams(pipedOutputStream, pipedInputStream, StreamCommutator.REMOTE);
        commutator.addStreams(container);

        return commutator;
    }
View Full Code Here


        return manager.getUsrCommutator();
    }

    private static StreamCommutator singleGame() {
        logger.info("creating single game");
        StreamCommutator commutator = new StreamCommutator();
        commutator.addStreams(System.out, System.in, StreamCommutator.LOCAL);
        commutator.addStreams(System.out, System.in, StreamCommutator.LOCAL);
        return commutator;
    }
View Full Code Here

        logger.info("creating server at port" + port);
        return createServerCommutator(new ServerSocket(port).accept());
    }

    private static StreamCommutator createServerCommutator(Socket serverClient) throws IOException {
        StreamCommutator commutator = new StreamCommutator();
        commutator.addStreams(System.out, System.in, StreamCommutator.LOCAL);
        commutator.addStreams(serverClient.getOutputStream(), serverClient.getInputStream(), StreamCommutator.REMOTE);
        return commutator;
    }
View Full Code Here

        logger.info("crating client game for server " + host + ":" + port);
        return createClientCommutator(new Socket(host, port));
    }

    private static StreamCommutator createClientCommutator(Socket client) throws IOException {
        StreamCommutator commutator = new StreamCommutator();
        commutator.addStreams(client.getOutputStream(), client.getInputStream(), StreamCommutator.REMOTE);
        commutator.addStreams(System.out, System.in, StreamCommutator.LOCAL);
        return commutator;
    }
View Full Code Here

TOP

Related Classes of streams.StreamCommutator

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.