private void doHandle() {
            if (!in.isEmpty() && busy.compareAndSet(false, true)) {
                threadpool.submit(new Runnable() {
                    @Override
                    public void run() {
                        ZMessageBuffer messages = SocketDispatcher.this.messages.get();
                        messages.drainFrom(in);
                        busy.set(false);
                        for (int i = 0; i <= messages.lastValidIndex; i++) {
                            if (active) {
                                handler.handleMessage(sender, messages.buffer[i]);
                            }
                        }
                    }
                });
            }
        }