示例#1
0
        protected override void readSocketData()
        {
            int bytesToRead = socket.GetStream().Read(readBytes, 0, getReadBufferSize());

            if (bytesToRead <= 0)
            {
                return;
            }
            readBuffer.clear();
            readBuffer.put(readBytes, 0, bytesToRead);
            decoder.decode(readBuffer, messageQueue);
            if (messageQueue.Count > 0)
            {
                EzyMessage message    = messageQueue.Dequeue();
                Object     socketData = decoder.decode(message);
                getLogger().debug("receiver data: " + socketData);
                dataEventQueue.add(new EzySocketDataEvent(socketData));
            }
        }
        public Object decode(EzyMessage message)
        {
            Object answer = decoder.decode(message);

            return(answer);
        }