changeset 553:80af3ca1b618

minor
author Devel 1
date Mon, 18 Sep 2017 12:27:16 +0200
parents 8324c4591ad2
children b54118ccc0e0
files stress-tester/src/main/java/com/passus/st/emitter/nio/NioChannelContext.java stress-tester/src/main/java/com/passus/st/emitter/nio/NioEmitterWorker.java
diffstat 2 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/emitter/nio/NioChannelContext.java	Mon Sep 18 12:11:58 2017 +0200
+++ b/stress-tester/src/main/java/com/passus/st/emitter/nio/NioChannelContext.java	Mon Sep 18 12:27:16 2017 +0200
@@ -11,7 +11,6 @@
 import java.nio.channels.SocketChannel;
 import java.util.LinkedList;
 import java.util.Queue;
-import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  *
@@ -33,8 +32,6 @@
 
     private SelectionKey key;
 
-    public static AtomicInteger writes = new AtomicInteger();
-    
     public NioChannelContext(NioEmitterWorker worker, SocketChannel channel, SocketAddress remoteAddress, SessionInfo sessionInfo) {
         this.worker = worker;
         this.channel = channel;
@@ -54,7 +51,6 @@
 
     private void addToQeueu(ByteBuffer buffer) throws IOException {
         dataQueue.add(buffer);
-        writes.incrementAndGet();
     }
 
     @Override
--- a/stress-tester/src/main/java/com/passus/st/emitter/nio/NioEmitterWorker.java	Mon Sep 18 12:11:58 2017 +0200
+++ b/stress-tester/src/main/java/com/passus/st/emitter/nio/NioEmitterWorker.java	Mon Sep 18 12:27:16 2017 +0200
@@ -308,7 +308,6 @@
 
         //TODO Operacje na handlerach powinny przechodzic przez Executor
         try {
-            NioChannelContext.writes.decrementAndGet();
             keyContext.handler.dataWritten(keyContext.channelContext);
             LOGGER.debug("Write handled.");
         } catch (Exception e) {
@@ -330,7 +329,7 @@
 
         ByteBuffer buffer = keyContext.buffer;
 
-        keyContext.buffer.clear();
+        buffer.clear();
 
         ByteBuff buff = new HeapByteBuff();
         int totalReaded = 0;