Package org.activeio

Examples of org.activeio.Channel


        SocketMetadata socket = (SocketMetadata) clientChannel.narrow(SocketMetadata.class);
        if( socket != null )
            socket.setTcpNoDelay(true);
        log.info("Get connection that was accepted on the server side.");
       
        Channel c = server.accept(1000*5);
  assertNotNull(c);
        
        serverChannel = AsynchToSynchChannelAdapter.adapt(c);
        serverChannel.start();
        socket = (SocketMetadata) serverChannel.narrow(SocketMetadata.class);               
View Full Code Here


    class SlowWriteSynchChannelServer extends FilterSynchChannelServer {
        public SlowWriteSynchChannelServer(SynchChannelServer next) {
            super(next);
        }
        public Channel accept(long timeout) throws IOException {
            Channel channel = super.accept(timeout);
            if( channel != null ) {
                channel =  new SlowWriteSynchChannel((SynchChannel) channel);
            }
            return channel;
        }
View Full Code Here

            return 0;
        return (int) timeout;
    }

    public Socket accept() throws IOException {
        Channel channel = channelServer.accept(timeout);
        if( channel==null )
            throw new InterruptedIOException();
       
        SynchChannel synchChannel = AsynchToSynchChannelAdapter.adapt(channel);           
        synchChannel.start();
View Full Code Here

        String oldName = Thread.currentThread().getName();       
        Thread.currentThread().setName( synchChannelServer.toString() );
        try {
          while (running.get()) {
              try {
                  Channel channel = synchChannelServer.accept(500);
                  if( channel == null )
                      continue;               
                  acceptListener.onAccept(channel);
              } catch (IOException e) {
                  if( running.get() )
View Full Code Here

                        setAsynchChannelListener(null);
                    } catch (IOException e) {                       
                        getAsynchChannelListener().onPacketError(e);
                    }
                   
                    Channel channel = getNext();
                    channel = AsynchToSynchChannelAdapter.adapt(channel);
                    channel = new PushbackSynchChannel((SynchChannel) channel, buffer);
                    channel = SynchToAsynchChannelAdapter.adapt(channel);
                   
                    onePort.onAccept(channel);
View Full Code Here

TOP

Related Classes of org.activeio.Channel

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.