Package de.fhkn.in.uce.connectivitymanager.connection

Examples of de.fhkn.in.uce.connectivitymanager.connection.UCESocket


     *
     * @throws Exception
     */
    public void startChatSource() throws Exception {
        System.out.println("Connecting to target " + this.targetId + " ...");
        final UCESocket socketTpPartner = UCEUnsecureSocketFactory.getInstance().createSourceSocket(this.targetId);
        socketTpPartner.connect();
        System.out.println("Connection to " + this.targetId + " established");
        System.out.println("Starting threads for processing ...");
        final Executor executor = Executors.newCachedThreadPool();
        executor.execute(new ReaderTask(socketTpPartner.getOutputStream()));
        executor.execute(new PrinterTask(socketTpPartner.getInputStream()));
        System.out.println("Ready to chat ...");
    }
View Full Code Here


     *
     * @throws Exception
     */
    public void startChatTarget() throws Exception {
        System.out.println("Starting target " + this.targetId + " and waiting for source ...");
        final UCESocket socketTpPartner = UCEUnsecureSocketFactory.getInstance().createTargetSocket(this.targetId);
        socketTpPartner.connect();
        System.out.println("Connection established");
        System.out.println("Starting threads for processing ...");
        final Executor executor = Executors.newCachedThreadPool();
        executor.execute(new ReaderTask(socketTpPartner.getOutputStream()));
        executor.execute(new PrinterTask(socketTpPartner.getInputStream()));
        System.out.println("Ready to chat ...");
    }
View Full Code Here

TOP

Related Classes of de.fhkn.in.uce.connectivitymanager.connection.UCESocket

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.