Package org.nustaq.net

Examples of org.nustaq.net.TCPObjectSocket


        });
    }

    volatile boolean ok = false;
    public void client() throws Exception {
        TCPObjectSocket socket = new TCPObjectSocket("localhost", 5555);

        // send request
        HashMap toWrite = new HashMap();
        toWrite.put("Greetings form year ", 2014 );
        toWrite.put("Random ", Math.random() );
        socket.writeObject(toWrite);
        socket.flush();                             // <== important, else nothing happens !

        // await 2 responses
        System.out.println(socket.readObject());
        System.out.println(socket.readObject());

        // done, close
        socket.close();
        ok = true;
    }
View Full Code Here

TOP

Related Classes of org.nustaq.net.TCPObjectSocket

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.