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)); }
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; }