Ejemplo n.º 1
0
        void TransparentStreamSeekRequestMessageReceived(TransparentStreamMessageBase transparentStreamMessageBase)
        {
            TransparentStreamSeekRequestMessage request = (TransparentStreamSeekRequestMessage)transparentStreamMessageBase;
            Exception exception = null;
            long      seek      = -1;

            try {
                seek = baseStream.Seek(request.Offset, request.SeekOrigin);
            } catch (Exception ex) {
                exception = ex;
            }
            objectBusSession.SendMessage(new TransparentStreamSeekResponseMessage(streamID, request.ID, seek, exception));
        }
Ejemplo n.º 2
0
		public IAsyncResult BeginSeek (long offset, System.IO.SeekOrigin origin)
		{
			TransparentStreamSeekRequestMessage request = new TransparentStreamSeekRequestMessage (Guid.NewGuid (), streamID, offset, origin);
			TransparentStreamAsyncResult result = new TransparentStreamAsyncResult (null);
			if (!pendingSeekRequests.TryAdd (request.ID, result)) {
				throw new Exception ("request failed before sending.");
			}
			objectBusSession.SendMessage (request);
			return result;
		}