Package nanomsg.async

Examples of nanomsg.async.IAsyncRunnable


    }

    public void run() {
        while (true) {
            try {
                final IAsyncRunnable handler = queue.take();
                try {
                    handler.run();
                } catch (IOException e) {
                    final int errno = e.getErrno();
                    if (errno == Nanomsg.constants.EAGAIN) {
                        queue.put(handler);
                    }
View Full Code Here


     *
     * @param data string to send.
     * @param callback IAsyncCallback interface object.
     */
    public void sendString(final String data, final IAsyncCallback<Boolean> callback) throws InterruptedException {
        scheduler.schedule(new IAsyncRunnable() {
            public void run() throws EAgainException {
                try {
                    socket.sendString(data);
                    callback.success(true);
                } catch (IOException e) {
View Full Code Here

     * any data received.
     *
     * @param callback IAsyncCallback interface object.
     */
    public void recvString(final IAsyncCallback<String> callback) throws InterruptedException {
        scheduler.schedule(new IAsyncRunnable() {
            public void run() throws EAgainException {
                try {
                    final String received = socket.recvString();
                    callback.success(received);
                } catch (IOException e) {
View Full Code Here

     *
     * @param data string to send.
     * @param callback IAsyncCallback interface object.
     */
    public void sendBytes(final byte[] data, final IAsyncCallback<Boolean> callback) throws InterruptedException {
        scheduler.schedule(new IAsyncRunnable() {
            public void run() throws EAgainException {
                try {
                    socket.sendBytes(data);
                    callback.success(true);
                } catch (IOException e) {
View Full Code Here

     * any data received.
     *
     * @param callback IAsyncCallback interface object.
     */
    public void recvBytes(final IAsyncCallback<byte[]> callback) throws InterruptedException {
        scheduler.schedule(new IAsyncRunnable() {
            public void run() throws EAgainException {
                try {
                    final byte[] received = socket.recvBytes();
                    callback.success(received);
                } catch (IOException e) {
View Full Code Here

TOP

Related Classes of nanomsg.async.IAsyncRunnable

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.