/// <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.ClientTaskAsync") ?? _DefaultServerAttribute_;
         if (attribute.Name == null) attribute.Name = "AutoCSer.Example.TcpOpenStreamServer.ClientTaskAsync";
     }
     _TcpClient_ = new AutoCSer.Net.TcpOpenStreamServer.Client<TcpOpenStreamClient>(this, attribute, log, clientRoute);
     if (attribute.IsAutoClient) _TcpClient_.TryCreateSocket();
 }
Exemplo n.º 2
0
 /// <summary>
 /// AutoCSer.TestCase.TcpOpenStreamServerPerformance.OpenStreamServer TCP调用服务端
 /// </summary>
 /// <param name="attribute">TCP调用服务器端配置信息</param>
 /// <param name="value">TCP服务目标对象</param>
 /// <param name="log">日志接口</param>
 public TcpOpenStreamServer(AutoCSer.Net.TcpOpenStreamServer.ServerAttribute attribute = null, Func <System.Net.Sockets.Socket, bool> verify = null, AutoCSer.TestCase.TcpOpenStreamServerPerformance.OpenStreamServer value = null, AutoCSer.Log.ILog log = null)
     : base(attribute ?? (attribute = AutoCSer.Net.TcpOpenStreamServer.ServerAttribute.GetConfig("AutoCSer.TestCase.TcpOpenStreamServerPerformance.OpenStreamServer", typeof(AutoCSer.TestCase.TcpOpenStreamServerPerformance.OpenStreamServer))), verify, log)
 {
     Value = value ?? new AutoCSer.TestCase.TcpOpenStreamServerPerformance.OpenStreamServer();
     setCommandData(2);
     setCommand(0);
     setCommand(1);
     if (attribute.IsAutoServer)
     {
         Start();
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// TCP调用客户端
 /// </summary>
 /// <param name="attribute">TCP调用服务器端配置信息</param>
 /// <param name="log">日志接口</param>
 public TcpOpenStreamClient(AutoCSer.Net.TcpOpenStreamServer.ServerAttribute attribute = null, AutoCSer.Log.ILog log = null)
 {
     if (attribute == null)
     {
         attribute = AutoCSer.Config.Loader.Get <AutoCSer.Net.TcpOpenStreamServer.ServerAttribute>("AutoCSer.Example.TcpOpenStreamServer.NoAttribute") ?? AutoCSer.Json.Parser.Parse <AutoCSer.Net.TcpOpenStreamServer.ServerAttribute>(@"{""CheckSeconds"":59,""ClientOutputSleep"":-1,""ClientSegmentationCopyPath"":null,""ClientSendBufferMaxSize"":0x100000,""ClientTryCreateSleep"":1000,""GenericType"":null,""Host"":""127.0.0.1"",""IsAttribute"":false,""IsAutoClient"":false,""IsAutoServer"":true,""IsBaseTypeAttribute"":false,""IsClientAwaiter"":false,""IsCompileSerialize"":true,""IsJsonSerialize"":true,""IsMarkData"":false,""IsRemoteExpression"":false,""IsSegmentation"":true,""IsServerBuildOutputThread"":false,""IsSimpleSerialize"":true,""MaxInputSize"":0x3FF4,""MaxVerifyDataSize"":1024,""MemberFilters"":""Instance"",""MinCompressSize"":0,""Name"":null,""Port"":0x3584,""ReceiveBufferSize"":""Kilobyte8"",""ReceiveVerifyCommandSeconds"":9,""RemoteExpressionServerTask"":""Timeout"",""SendBufferSize"":""Kilobyte8"",""ServerOutputSleep"":-1,""ServerSendBufferMaxSize"":0,""ServerTaskType"":""Queue"",""VerifyString"":null,""TypeId"":{}}");
         if (attribute.Name == null)
         {
             attribute.Name = "AutoCSer.Example.TcpOpenStreamServer.NoAttribute";
         }
     }
     _TcpClient_ = new AutoCSer.Net.TcpOpenStreamServer.Client <TcpOpenStreamClient>(this, attribute, log);
     if (attribute.IsAutoClient)
     {
         _TcpClient_.TryCreateSocket();
     }
 }