예제 #1
0
        bool tryAllocate(out T message)
        {
            int bufferId;
            int bufferOffset;
            int bufferSize;

            byte[] bufferHandle;

            if (bufferManager.TryAllocateBuffer(out bufferId, out bufferOffset, out bufferSize, out bufferHandle))
            {
                message = producer.Get();
                message.SetBuffer(bufferManager, bufferHandle, bufferId, bufferOffset, bufferSize);
                message.BufferAssigned();
                return(true);
            }

            message = null;
            return(false);
        }