Package net.sf.cindy

Examples of net.sf.cindy.Session.send()


        while (true) {
            int count = System.in.read(b);
            if (count < 0)
                break;
            // block send
            if (!session.send(BufferFactory.wrap(b, 0, count)).complete())
                break;
        }
    }

    private static Session startSession(boolean tcp, String host, int port) {
View Full Code Here


        // send message to other user
        synchronized (sessions) {
            for (Iterator iter = sessions.iterator(); iter.hasNext();) {
                Session session = (Session) iter.next();
                if (session != srcSession) {
                    session.send(message);
                }
            }
        }
    }
View Full Code Here

        // start session
        session.start().complete();

        // start send
        session.send("hello, world!");
        session.send(new Integer(Integer.MAX_VALUE));
        session.send(new Double(Math.random()));
        session.send(new User("User 1", 20));

        // send object and close the session
View Full Code Here

        // start session
        session.start().complete();

        // start send
        session.send("hello, world!");
        session.send(new Integer(Integer.MAX_VALUE));
        session.send(new Double(Math.random()));
        session.send(new User("User 1", 20));

        // send object and close the session
        session.send("bye!").addListener(new FutureListener() {
View Full Code Here

        session.start().complete();

        // start send
        session.send("hello, world!");
        session.send(new Integer(Integer.MAX_VALUE));
        session.send(new Double(Math.random()));
        session.send(new User("User 1", 20));

        // send object and close the session
        session.send("bye!").addListener(new FutureListener() {
View Full Code Here

        // start send
        session.send("hello, world!");
        session.send(new Integer(Integer.MAX_VALUE));
        session.send(new Double(Math.random()));
        session.send(new User("User 1", 20));

        // send object and close the session
        session.send("bye!").addListener(new FutureListener() {

            public void futureCompleted(Future future) throws Exception {
View Full Code Here

        session.send(new Integer(Integer.MAX_VALUE));
        session.send(new Double(Math.random()));
        session.send(new User("User 1", 20));

        // send object and close the session
        session.send("bye!").addListener(new FutureListener() {

            public void futureCompleted(Future future) throws Exception {
                future.getSession().close();
            }
        });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.