示例#1
0
 protected void removeWriteBuffer(Socket socket) {
   synchronized (this.responseBuffers) {
     List<ByteBuffer> existing = this.responseBuffers.get(socket);
     if (existing != null && !existing.isEmpty()) {
       existing.remove(0);
     } else {
       this.responseBuffers.remove(socket);
     }
   }
 }
示例#2
0
 protected void putWriteBuffer(Socket socket, ByteBuffer data) {
   synchronized (this.responseBuffers) {
     List<ByteBuffer> existing = this.responseBuffers.get(socket);
     if (existing != null) {
       existing.add(data);
     } else {
       LinkedList<ByteBuffer> list = new LinkedList<ByteBuffer>();
       list.add(data);
       this.responseBuffers.put(socket, list);
     }
   }
 }