Esempio n. 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);
     }
   }
 }
Esempio n. 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);
     }
   }
 }