Package com.hazelcast.nio

Examples of com.hazelcast.nio.Packet.writeTo()


        final int bufferSize = SocketOptions.DEFAULT_BUFFER_SIZE_BYTE;
        final ByteBuffer buffer = ByteBuffer.allocate(totalSize > bufferSize ? bufferSize : totalSize);
        final Packet packet = new Packet(data, serializationService.getPortableContext());
        boolean complete = false;
        while (!complete) {
            complete = packet.writeTo(buffer);
            buffer.flip();
            try {
                socketChannelWrapper.write(buffer);
            } catch (Exception e) {
                throw ExceptionUtil.rethrow(e);
View Full Code Here


        ClientPrincipal principal = new ClientPrincipal("uuid", "uuid2");
        Data data = ss.toData(new AuthenticationRequest(credentials, principal));

        Packet packet = new Packet(data, ss.getPortableContext());
        ByteBuffer buffer = ByteBuffer.allocate(1024);
        assertTrue(packet.writeTo(buffer));

        SerializationService ss2 = createSerializationService(1);

        buffer.flip();
        packet = new Packet(ss2.getPortableContext());
View Full Code Here

        final int totalSize = packet.size();
        final int bufferSize = SocketOptions.DEFAULT_BUFFER_SIZE_BYTE;
        final ByteBuffer buffer = ByteBuffer.allocate(totalSize > bufferSize ? bufferSize : totalSize);
        boolean complete = false;
        while (!complete) {
            complete = packet.writeTo(buffer);
            buffer.flip();
            try {
                socketChannelWrapper.write(buffer);
            } catch (Exception e) {
                throw ExceptionUtil.rethrow(e);
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.