Examples of ByteCounter


Examples of com.biasedbit.nettytutorials.customcodecs.common.ByteCounter

        ChannelPipelineFactory pipelineFactory = new ChannelPipelineFactory() {

            @Override
            public ChannelPipeline getPipeline() throws Exception {
                ChannelPipeline pipeline = Channels.pipeline();
                pipeline.addLast("byteCounter", new ByteCounter("clientByteCounter"));
                pipeline.addLast("encoder", new ObjectEncoder());
                pipeline.addLast("decoder", new ObjectDecoder());
                pipeline.addLast("handler", handler);
                return pipeline;
            }
View Full Code Here

Examples of com.biasedbit.nettytutorials.customcodecs.common.ByteCounter

        ChannelPipelineFactory pipelineFactory = new ChannelPipelineFactory() {

            @Override
            public ChannelPipeline getPipeline() throws Exception {
                ChannelPipeline pipeline = Channels.pipeline();
                pipeline.addLast("byteCounter", new ByteCounter("clientByteCounter"));
                pipeline.addLast("encoder", Encoder.getInstance());
                pipeline.addLast("decoder", new Decoder());
                pipeline.addLast("handler", handler);
                return pipeline;
            }
View Full Code Here

Examples of com.biasedbit.nettytutorials.handshake.common.ByteCounter

        final DelimiterBasedFrameDecoder frameDecoder =
                new DelimiterBasedFrameDecoder(Integer.MAX_VALUE,
                                               Delimiters.lineDelimiter());
        this.bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() throws Exception {
                ByteCounter byteCounter =
                        new ByteCounter("--- CLIENT-COUNTER :: ");
                MessageCounter messageCounter =
                        new MessageCounter("--- CLIENT-MSGCOUNTER :: ");
                ClientHandshakeHandler handshakeHandler =
                        new ClientHandshakeHandler(id, serverId, 5000);
View Full Code Here

Examples of com.biasedbit.nettytutorials.handshake.common.ByteCounter

                                               Delimiters.lineDelimiter());
        this.bootstrap.setPipelineFactory(new ChannelPipelineFactory() {

            @Override
            public ChannelPipeline getPipeline() throws Exception {
                ByteCounter counter =
                        new ByteCounter("+++ SERVER-COUNTER :: ");
                MessageCounter messageCounter =
                        new MessageCounter("+++ SERVER-MSGCOUNTER :: ");
                ServerHandshakeHandler handshakeHandler =
                        new ServerHandshakeHandler(id, channelGroup, 5000);
                return Channels.pipeline(counter,
View Full Code Here

Examples of com.mucommander.commons.io.ByteCounter

     * Creates a new TransferFileJob.
     */
    public TransferFileJob(ProgressDialog progressDialog, MainFrame mainFrame, FileSet files) {
        super(progressDialog, mainFrame, files);

        this.currentFileByteCounter = new ByteCounter();
        this.currentFileSkippedByteCounter = new ByteCounter();

        // Account the current file's byte counter in the total byte counter
        this.totalByteCounter = new ByteCounter(currentFileByteCounter);
        this.totalSkippedByteCounter = new ByteCounter(currentFileSkippedByteCounter);
    }
View Full Code Here

Examples of freenet.io.comm.ByteCounter

      if(logMINOR) Logger.minor(this, "Handling request off thread, source no longer routable: "+source+" for "+m);
      rejectRequest(m, isSSK ? node.nodeStats.sskRequestCtr : node.nodeStats.chkRequestCtr);
      return;
    }
    long id = m.getLong(DMT.UID);
    ByteCounter ctr = isSSK ? node.nodeStats.sskRequestCtr : node.nodeStats.chkRequestCtr;
        short htl = m.getShort(DMT.HTL);
    if(htl <= 0) htl = 1;
        Key key = (Key) m.getObject(DMT.FREENET_ROUTING_KEY);
        boolean realTimeFlag = DMT.getRealTimeFlag(m);
        final RequestTag tag = new RequestTag(isSSK, RequestTag.START.REMOTE, source, realTimeFlag, id, node);
View Full Code Here

Examples of freenet.io.comm.ByteCounter

   * @param m The incoming message.
   * @param source The node that sent the message.
   * @param isSSK True if it is an SSK insert, false if it is a CHK insert.
   */
  private void handleInsertRequest(Message m, PeerNode source, boolean isSSK) {
    ByteCounter ctr = isSSK ? node.nodeStats.sskInsertCtr : node.nodeStats.chkInsertCtr;
    long id = m.getLong(DMT.UID);
        boolean realTimeFlag = DMT.getRealTimeFlag(m);
    InsertTag tag = new InsertTag(isSSK, InsertTag.START.REMOTE, source, realTimeFlag, id, node);
    if(!tracker.lockUID(id, isSSK, true, false, false, realTimeFlag, tag)) {
      if(logMINOR) Logger.minor(this, "Could not lock ID "+id+" -> rejecting (already running)");
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.