void TransparentStreamSetLengthRequestMessageReceived(TransparentStreamMessageBase transparentStreamMessageBase)
        {
            TransparentStreamSetLengthRequestMessage request = (TransparentStreamSetLengthRequestMessage)transparentStreamMessageBase;
            Exception exception = null;

            try {
                baseStream.SetLength(request.Length);
            } catch (Exception ex) {
                exception = ex;
            }
            objectBusSession.SendMessage(new TransparentStreamSetLengthResponseMessage(streamID, request.ID, exception));
        }
Exemplo n.º 2
0
		public IAsyncResult BeginSetLength (long value)
		{
			TransparentStreamSetLengthRequestMessage request = new TransparentStreamSetLengthRequestMessage (Guid.NewGuid (), streamID, value);
			TransparentStreamAsyncResult result = new TransparentStreamAsyncResult (null);
			if (!pendingSetLengthRequests.TryAdd (request.ID, result)) {
				throw new Exception ("request failed before sending.");
			}
			objectBusSession.SendMessage (request);
			return result;
		}