private void processDataFrame(int channelPtr,
                                  int ctype,
                                  int flag,
                                  ByteBuffer data) {
        Channel channel;
        ByteBuffer datac;
        Iterator<Channel> it;
        int size;

        if (data == null || data.capacity() == 0) {
            destroy(new ChannelError("Zero data frame received"));
            return;
        }

        size = data.capacity();

        if (channelPtr == 0) {
            it = m_openChannels.values().iterator();
            while (it.hasNext()) {
                channel = it.next();
                datac = ByteBuffer.allocate(size);
                datac.put(data);
                datac.flip();
                data.rewind();
                channel.addEvent(new ChannelData(channel, ctype, flag, datac));
            }

            return;   
        }

        channel = m_openChannels.get(channelPtr);

        if (channel == null) {
            destroy(new ChannelError("Invalid channel"));
            return;
        }

        channel.addEvent(new ChannelData(channel, ctype, flag, data));
    }