コード例 #1
0
        void TransparentStreamFlushRequestMessageReceived(TransparentStreamMessageBase transparentStreamMessageBase)
        {
            TransparentStreamFlushRequestMessage request = (TransparentStreamFlushRequestMessage)transparentStreamMessageBase;
            Exception exception = null;

            try {
                baseStream.Flush();
            } catch (Exception ex) {
                exception = ex;
            }
            objectBusSession.SendMessage(new TransparentStreamFlushResponseMessage(streamID, request.ID, exception));
        }
コード例 #2
0
ファイル: TransparentStream.cs プロジェクト: vebin/BD2
		public IAsyncResult BeginFlush ()
		{
			TransparentStreamFlushRequestMessage request = new TransparentStreamFlushRequestMessage (Guid.NewGuid (), streamID);
			TransparentStreamAsyncResult result = new TransparentStreamAsyncResult (null);
			if (!pendingFlushRequests.TryAdd (request.ID, result)) {
				throw new Exception ("request failed before sending.");
			}
			objectBusSession.SendMessage (request);
			return result;
		}