Package nanomsg.exceptions

Examples of nanomsg.exceptions.IOException


    @Override
    public void subscribe(final String topic) throws IOException {
        try {
            subscribe(topic.getBytes("utf-8"));
        } catch (UnsupportedEncodingException e) {
            throw new IOException(e);
        }
    }
View Full Code Here


    @Override
    public void unsubscribe(final String topic) throws IOException {
        try {
            unsubscribe(topic.getBytes("utf-8"));
        } catch (UnsupportedEncodingException e) {
            throw new IOException(e);
        }
    }
View Full Code Here

            final int rc = NativeLibrary.nn_close(this.socket);

            if (rc < 0) {
                final int errno = Nanomsg.getErrorNumber();
                final String msg = Nanomsg.getError();
                throw new IOException(msg, errno);
            }
        }
    }
View Full Code Here

        final int rc = NativeLibrary.nn_bind(this.socket, dir);

        if (rc < 0) {
            final int errno = Nanomsg.getErrorNumber();
            final String msg = Nanomsg.getError();
            throw new IOException(msg, errno);
        }
    }
View Full Code Here

        final int rc = NativeLibrary.nn_connect(this.socket, dir);

        if (rc < 0) {
            final int errno = Nanomsg.getErrorNumber();
            final String msg = Nanomsg.getError();
            throw new IOException(msg, errno);
        }
    }
View Full Code Here

        final int rc = NativeLibrary.nn_send(socket, data, data.length, blocking ? 0 : Nanomsg.constants.NN_DONTWAIT);

        if (rc < 0) {
            final int errno = Nanomsg.getErrorNumber();
            final String msg = Nanomsg.getError();
            throw new IOException(msg, errno);
        }

        return rc;
    }
View Full Code Here

        final int received = NativeLibrary.nn_recv(socket, ptrBuff, Nanomsg.constants.NN_MSG, blocking ? 0: Nanomsg.constants.NN_DONTWAIT);

        if (received < 0) {
            final int errno = Nanomsg.getErrorNumber();
            final String msg = Nanomsg.getError();
            throw new IOException(msg, errno);
        }

        final Pointer result = ptrBuff.getValue();
        final byte[] bytesResult = result.getByteArray(0, received);
View Full Code Here

        final int rc = NativeLibrary.nn_getsockopt(this.socket, Nanomsg.constants.NN_SOL_SOCKET,
                                                   flag, fd.getPointer(), size_t.getPointer());

        if (rc < 0) {
            throw new IOException(Nanomsg.getError());
        }

        if (rc < 0) {
            final int errno = Nanomsg.getErrorNumber();
            final String msg = Nanomsg.getError();
            throw new IOException(msg, errno);
        }

        return fd.getValue();
    }
View Full Code Here

TOP

Related Classes of nanomsg.exceptions.IOException

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.