protected void onReceive(ReturnType type) { ClientCommand.Command command = CommandPool.GetCommand((int)CommandIndex); if (command != null) { SubArray <byte> data = new SubArray <byte> { Start = (int)(byte)type }; command.OnReceive(ref data); } }
protected void onReceive() { ClientCommand.Command command = CommandPool.GetCommand((int)CommandIndex); if (command != null) { SubArray <byte> data = new SubArray <byte> { Array = ReceiveBuffer.Buffer, Start = ReceiveBuffer.StartIndex + receiveIndex, Length = dataSize }; command.OnReceive(ref data); } }
internal void OnReceive(ref SubBuffer.PoolBufferFull buffer) { ClientCommand.Command command = CommandPool.GetCommand((int)CommandIndex); if (command == null) { buffer.Free(); } else { SubArray <byte> data = new SubArray <byte> { Array = buffer.Buffer, Start = buffer.StartIndex, Length = dataSize }; try { command.OnReceive(ref data); } finally { buffer.Free(); } } }