Esempio n. 1
0
 /// <summary>
 /// TCP 内部服务客户端
 /// </summary>
 /// <param name="attribute">TCP服务调用配置</param>
 /// <param name="log">日志接口</param>
 /// <param name="clientRoute">TCP 客户端路由</param>
 internal Client(ServerAttribute attribute, ILog log, AutoCSer.Net.TcpServer.ClientLoadRoute <ClientSocketSender> clientRoute)
     : base(attribute, log)
 {
     this.clientRoute = clientRoute;
     if (attribute.TcpRegisterName != null)
     {
         tcpRegisterClient = AutoCSer.Net.TcpRegister.Client.Get(attribute.TcpRegisterName, Log);
         tcpRegisterClient.Register(this);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// TCP调用客户端
 /// </summary>
 /// <param name="attribute">TCP调用服务器端配置信息</param>
 /// <param name="clientRoute">TCP 客户端路由</param>
 /// <param name="log">日志接口</param>
 public TcpOpenStreamClient(AutoCSer.Net.TcpOpenStreamServer.ServerAttribute attribute = null, AutoCSer.Net.TcpServer.ClientLoadRoute <AutoCSer.Net.TcpOpenStreamServer.ClientSocketSender> clientRoute = null, AutoCSer.Log.ILog log = null)
 {
     if (attribute == null)
     {
         attribute = AutoCSer.Config.Loader.Get <AutoCSer.Net.TcpOpenStreamServer.ServerAttribute>("AutoCSer.Example.TcpOpenStreamServer.Static") ?? _DefaultServerAttribute_;
         if (attribute.Name == null)
         {
             attribute.Name = "AutoCSer.Example.TcpOpenStreamServer.Static";
         }
     }
     _TcpClient_ = new AutoCSer.Net.TcpOpenStreamServer.Client <TcpOpenStreamClient>(this, attribute, log, clientRoute);
     if (attribute.IsAutoClient)
     {
         _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.Config.Loader.Get <AutoCSer.Net.TcpOpenServer.ServerAttribute>("AutoCSer.Example.TcpOpenServer.KeepCallback") ?? _DefaultServerAttribute_;
         if (attribute.Name == null)
         {
             attribute.Name = "AutoCSer.Example.TcpOpenServer.KeepCallback";
         }
     }
     _TcpClient_ = new AutoCSer.Net.TcpOpenServer.Client <TcpOpenClient>(this, attribute, onCustomData, log, clientRoute);
     if (attribute.IsAutoClient)
     {
         _TcpClient_.TryCreateSocket();
     }
 }
 /// <summary>
 /// TCP调用客户端
 /// </summary>
 /// <param name="attribute">TCP 调用服务器端配置信息</param>
 /// <param name="clientRoute">TCP 客户端路由</param>
 /// <param name="onCustomData">自定义数据包处理</param>
 /// <param name="log">日志接口</param>
 public TcpInternalClient(AutoCSer.Net.TcpInternalServer.ServerAttribute attribute = 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("AutoCSer.TestCase.Nuget.Server", typeof(AutoCSer.TestCase.Nuget.Server));
     }
     _TcpClient_ = new AutoCSer.Net.TcpInternalServer.Client <TcpInternalClient>(this, attribute, onCustomData, log, clientRoute);
     if (attribute.IsAuto)
     {
         _TcpClient_.TryCreateSocket();
     }
 }
Esempio n. 5
0
 /// <summary>
 /// TCP 开放服务客户端
 /// </summary>
 /// <param name="attribute">TCP服务调用配置</param>
 /// <param name="onCustomData">自定义数据包处理</param>
 /// <param name="log">日志接口</param>
 /// <param name="clientRoute">TCP 客户端路由</param>
 internal Client(ServerAttribute attribute, Action <SubArray <byte> > onCustomData, ILog log, AutoCSer.Net.TcpServer.ClientLoadRoute <ClientSocketSender> clientRoute)
     : base(attribute, onCustomData, log)
 {
     this.clientRoute = clientRoute;
 }
Esempio n. 6
0
 /// <summary>
 /// TCP 内部服务客户端
 /// </summary>
 /// <param name="attribute">TCP服务调用配置</param>
 /// <param name="onCustomData">自定义数据包处理</param>
 /// <param name="log">日志接口</param>
 /// <param name="clientRoute">TCP 客户端路由</param>
 /// <param name="verifyMethod">验证委托</param>
 public Client(TcpInternalServer.ServerAttribute attribute, Action <SubArray <byte> > onCustomData, ILog log, AutoCSer.Net.TcpServer.ClientLoadRoute <AutoCSer.Net.TcpInternalServer.ClientSocketSender> clientRoute = null, Func <TcpInternalServer.ClientSocketSender, bool> verifyMethod = null)
     : base(attribute, onCustomData, log, clientRoute)
 {
     this.verifyMethod = verifyMethod;
 }
 /// <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.ILog log = null)
 {
     if (attribute == null)
     {
         attribute = (AutoCSer.Net.TcpOpenServer.ServerAttribute)AutoCSer.Configuration.Common.Get(typeof(AutoCSer.Net.TcpOpenServer.ServerAttribute), "AutoCSer.Example.TcpOpenServer.RefOut") ?? _DefaultServerAttribute_;
         if (attribute.Name == null)
         {
             attribute.Name = "AutoCSer.Example.TcpOpenServer.RefOut";
         }
     }
     _TcpClient_ = new AutoCSer.Net.TcpOpenServer.Client <TcpOpenClient>(this, attribute, 0, onCustomData, log, clientRoute);
     if (attribute.IsAutoClient)
     {
         _TcpClient_.TryCreateSocket();
     }
 }
Esempio n. 8
0
 /// <summary>
 /// TCP 开放服务客户端
 /// </summary>
 /// <param name="attribute">TCP服务调用配置</param>
 /// <param name="log">日志接口</param>
 /// <param name="clientRoute">TCP 客户端路由</param>
 internal Client(ServerAttribute attribute, ILog log, AutoCSer.Net.TcpServer.ClientLoadRoute <ClientSocketSender> clientRoute)
     : base(attribute, log)
 {
     this.clientRoute = clientRoute;
 }
Esempio n. 9
0
 /// <summary>
 /// TCP 内部服务客户端
 /// </summary>
 /// <param name="attribute">TCP服务调用配置</param>
 /// <param name="log">日志接口</param>
 /// <param name="clientRoute">TCP 客户端路由</param>
 /// <param name="verifyMethod">验证委托</param>
 public Client(TcpInternalStreamServer.ServerAttribute attribute, ILog log, AutoCSer.Net.TcpServer.ClientLoadRoute <AutoCSer.Net.TcpInternalStreamServer.ClientSocketSender> clientRoute = null, Func <TcpInternalStreamServer.ClientSocketSender, bool> verifyMethod = null)
     : base(attribute, log, clientRoute)
 {
     this.verifyMethod = verifyMethod;
 }