Package org.activeio

Examples of org.activeio.SynchChannel.narrow()


        log.info("HTTP response: " + b);
    }

    protected void hitIIOPServer() throws Exception {
        SynchChannel channel = channelFactory.openSynchChannel(server.getConnectURI());
        ((SocketMetadata)channel.narrow(SocketMetadata.class)).setTcpNoDelay(true);
        channel.write(new ByteArrayPacket("GIOPcrapcrap".getBytes("UTF-8")));
        channel.flush();
        channel.dispose();
    }
View Full Code Here


        channel.dispose();
    }

    public void testUnknownAccept() throws IOException, URISyntaxException, InterruptedException {
        SynchChannel channel = channelFactory.openSynchChannel(server.getConnectURI());
        ((SocketMetadata)channel.narrow(SocketMetadata.class)).setTcpNoDelay(true);
        channel
                .write(new ByteArrayPacket("Licensed under the Apache License, Version 2.0 (the \"License\")"
                        .getBytes("UTF-8")));
        channel.flush();
        String type = (String) resultSlot.poll(1000 * 5);
 
View Full Code Here

    }
   
    private static RequestChannel createRequestChannel(URI target) throws IOException, URISyntaxException {
        SocketSynchChannelFactory factory = new SocketSynchChannelFactory();
        SynchChannel channel = factory.openSynchChannel(target);
        SocketMetadata socket = (SocketMetadata) channel.narrow(SocketMetadata.class);
        socket.setTcpNoDelay(true);
        return new AsynchChannelToClientRequestChannel(
                 new PacketAggregatingSynchChannel(
                       channel));       
    }
View Full Code Here

        server.setAcceptListener(new AcceptListener() {
            public void onAccept(Channel channel) {
                RequestChannel requestChannel=null;
                try {
                    SynchChannel synchChannel = AsynchToSynchChannelAdapter.adapt(channel);
                    SocketMetadata socket = (SocketMetadata) synchChannel.narrow(SocketMetadata.class);
                    socket.setTcpNoDelay(true);
                   
                    requestChannel = createRequestChannel(synchChannel);    
                   
                    RequestChannelInterceptorInvoker invoker = new RequestChannelInterceptorInvoker(loginServiceInterceptor, loginService.getClass().getClassLoader() );
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.