void TransparentStreamGetLengthRequestMessageReceived(TransparentStreamMessageBase transparentStreamMessageBase)
        {
            TransparentStreamGetLengthRequestMessage request = (TransparentStreamGetLengthRequestMessage)transparentStreamMessageBase;
            Exception exception = null;
            long      length    = -1;

            try {
                length = baseStream.Length;
            } catch (Exception ex) {
                exception = ex;
            }
            objectBusSession.SendMessage(new TransparentStreamGetLengthResponseMessage(streamID, request.ID, length, exception));
        }
Example #2
0
		public IAsyncResult BeginGetLength ()
		{
			TransparentStreamGetLengthRequestMessage request = new  TransparentStreamGetLengthRequestMessage (Guid.NewGuid (), streamID);
			TransparentStreamAsyncResult result = new TransparentStreamAsyncResult (null);
			if (!pendingGetLengthRequests.TryAdd (request.ID, result)) {
				throw new Exception ("request failed before sending.");
			}
			objectBusSession.SendMessage (request);
			return result;
		}