1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using System.Threading.Tasks;
- using Vinno.IUS.Common.IO;
- namespace Vinno.IUS.Common.Network.Channels
- {
- internal interface IOutputChannelProxy : IChannelProxy
- {
- /// <summary>
- /// Send buffer to remote.
- /// </summary>
- /// <param name="buffer">The buffer to send</param>
- /// <param name="timeout">Wait forever if the value is 0</param>
- /// <returns>The return buffer from remote.</returns>
- IBuffer Send(IBuffer buffer, int timeout = 0);
- /// <summary>
- /// Send buffer to remote.
- /// </summary>
- /// <param name="buffer">The buffer to send</param>
- /// <param name="resultCallback">When receive a part of buffers, the callback will be called.</param>
- /// <param name="timeout">Wait forever if the value is 0</param>
- void Send(IBuffer buffer, Func<IBuffer, bool> resultCallback, int timeout = 0);
- /// <summary>
- /// Send buffer to remote by async way.
- /// </summary>
- /// <param name="buffer">The buffer to send</param>
- /// <param name="timeout">Wait forever if the value is 0</param>
- /// <returns>The return buffer from remote.</returns>
- Task<IBuffer> SendAsync(IBuffer buffer, int timeout = 0);
- /// <summary>
- /// Send buffer to remote by asnyc way.
- /// </summary>
- /// <param name="buffer">The buffer to send</param>
- /// <param name="resultCallback">When receive a part of buffers, the callback will be called.</param>
- /// <param name="timeout">Wait forever if the value is 0</param>
- Task SendAsync(IBuffer buffer, Func<IBuffer, bool> resultCallback, int timeout = 0);
- /// <summary>
- /// Indicate the channel was timeout
- /// </summary>
- /// <param name="channelId">The channelId</param>
- void SetTimeoutExceptionFlag(out int channelId);
- }
- }
|