void TransparentStreamCanReadRequestMessageReceived(TransparentStreamMessageBase transparentStreamMessageBase)
        {
            TransparentStreamCanReadRequestMessage request = (TransparentStreamCanReadRequestMessage)transparentStreamMessageBase;
            Exception exception = null;
            bool      canRead   = false;

            try {
                canRead = baseStream.CanRead;
            } catch (Exception ex) {
                exception = ex;
            }
            objectBusSession.SendMessage(new TransparentStreamCanReadResponseMessage(streamID, request.ID, canRead, exception));
        }
Example #2
0
		public IAsyncResult BeginCanRead ()
		{
			TransparentStreamCanReadRequestMessage request = new  TransparentStreamCanReadRequestMessage (Guid.NewGuid (), streamID);
			TransparentStreamAsyncResult result = new TransparentStreamAsyncResult (null);
			if (!pendingCanReadRequests.TryAdd (request.ID, result)) {
				throw new Exception ("request failed before sending.");
			}
			objectBusSession.SendMessage (request);
			return result;
		}