12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Net;
- namespace SuperSocket.SocketBase
- {
- /// <summary>
- /// Active connect result model
- /// </summary>
- public class ActiveConnectResult
- {
- /// <summary>
- /// Gets or sets a value indicating whether the conecting is sucessfull
- /// </summary>
- /// <value>
- /// <c>true</c> if result; otherwise, <c>false</c>.
- /// </value>
- public bool Result { get; set; }
- /// <summary>
- /// Gets or sets the connected session.
- /// </summary>
- /// <value>
- /// The connected session.
- /// </value>
- public IAppSession Session { get; set; }
- }
- /// <summary>
- /// The inerface to connect the remote endpoint actively
- /// </summary>
- public interface IActiveConnector
- {
- /// <summary>
- /// Connect the target endpoint actively.
- /// </summary>
- /// <param name="targetEndPoint">The target end point.</param>
- /// <returns></returns>
- Task<ActiveConnectResult> ActiveConnect(EndPoint targetEndPoint);
- /// <summary>
- /// Connect the target endpoint actively.
- /// </summary>
- /// <param name="targetEndPoint">The target end point.</param>
- /// <param name="localEndPoint">The local end point.</param>
- /// <returns></returns>
- Task<ActiveConnectResult> ActiveConnect(EndPoint targetEndPoint, EndPoint localEndPoint);
- }
- }
|