/// <summary>
 /// TCP调用客户端
 /// </summary>
 /// <param name="attribute">TCP 调用服务器端配置信息</param>
 /// <param name="clientRoute">TCP 客户端路由</param>
 /// <param name="log">日志接口</param>
 public TcpInternalStreamClient(AutoCSer.Net.TcpInternalStreamServer.ServerAttribute attribute = null, AutoCSer.Net.TcpServer.ClientLoadRoute <AutoCSer.Net.TcpInternalStreamServer.ClientSocketSender> clientRoute = null, AutoCSer.Log.ILog log = null)
 {
     if (attribute == null)
     {
         attribute = AutoCSer.Net.TcpInternalStreamServer.ServerAttribute.GetConfig("TcpInternalStreamServerPerformance", typeof(AutoCSer.TestCase.TcpInternalStreamServerPerformance.InternalStreamServer));
     }
     _TcpClient_ = new AutoCSer.Net.TcpInternalStreamServer.Client <TcpInternalStreamClient>(this, attribute, log, clientRoute);
     if (attribute.IsAuto)
     {
         _TcpClient_.TryCreateSocket();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// TCP调用客户端
 /// </summary>
 /// <param name="attribute">TCP 调用服务器端配置信息</param>
 /// <param name="verifyMethod">TCP 验证方法</param>
 /// <param name="clientRoute">TCP 客户端路由</param>
 /// <param name="onCustomData">自定义数据包处理</param>
 /// <param name="log">日志接口</param>
 public TcpInternalClient(AutoCSer.Net.TcpInternalServer.ServerAttribute attribute = null, Func <TcpInternalClient, AutoCSer.Net.TcpInternalServer.ClientSocketSender, bool> verifyMethod = null, AutoCSer.Net.TcpServer.ClientLoadRoute <AutoCSer.Net.TcpInternalServer.ClientSocketSender> clientRoute = null, Action <SubArray <byte> > onCustomData = null, AutoCSer.Log.ILog log = null)
 {
     if (attribute == null)
     {
         attribute = AutoCSer.Net.TcpInternalServer.ServerAttribute.GetConfig("TcpRegister", typeof(AutoCSer.Net.TcpRegister.Server));
     }
     _TcpClient_ = new AutoCSer.Net.TcpInternalServer.Client <TcpInternalClient>(this, attribute, 0, onCustomData, log, clientRoute, verifyMethod ?? (Func <TcpInternalClient, AutoCSer.Net.TcpInternalServer.ClientSocketSender, bool>)_timerVerify_);
     if (attribute.IsAuto)
     {
         _TcpClient_.TryCreateSocket();
     }
 }
Esempio n. 3
0
 /// <summary>
 /// TCP调用客户端
 /// </summary>
 /// <param name="attribute">TCP调用服务器端配置信息</param>
 /// <param name="clientRoute">TCP 客户端路由</param>
 /// <param name="onCustomData">自定义数据包处理</param>
 /// <param name="log">日志接口</param>
 public TcpOpenClient(AutoCSer.Net.TcpOpenServer.ServerAttribute attribute = null, AutoCSer.Net.TcpServer.ClientLoadRoute <AutoCSer.Net.TcpOpenServer.ClientSocketSender> clientRoute = null, Action <SubArray <byte> > onCustomData = null, AutoCSer.Log.ILog log = null)
 {
     if (attribute == null)
     {
         attribute = AutoCSer.Net.TcpOpenServer.ServerAttribute.GetConfig("AutoCSer.TestCase.TcpOpenServerPerformance.OpenServer", typeof(AutoCSer.TestCase.TcpOpenServerPerformance.OpenServer));
     }
     _TcpClient_ = new AutoCSer.Net.TcpOpenServer.Client <TcpOpenClient>(this, attribute, onCustomData, log, clientRoute);
     if (attribute.IsAutoClient)
     {
         _TcpClient_.TryCreateSocket();
     }
 }