コード例 #1
0
 /// <summary>
 /// TCP调用客户端
 /// </summary>
 /// <param name="attribute">TCP调用服务器端配置信息</param>
 /// <param name="log">日志接口</param>
 public TcpOpenSimpleClient(AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute attribute = null, AutoCSer.ILog log = null)
 {
     if (attribute == null)
     {
         attribute = (AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute)AutoCSer.Configuration.Common.Get(typeof(AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute), "AutoCSer.Example.TcpOpenSimpleServer.Asynchronous") ?? _DefaultServerAttribute_;
         if (attribute.Name == null) attribute.Name = "AutoCSer.Example.TcpOpenSimpleServer.Asynchronous";
     }
     _TcpClient_ = new AutoCSer.Net.TcpOpenSimpleServer.Client<TcpOpenSimpleClient>(this, attribute, log);
     if (attribute.IsAutoClient) _TcpClient_.TryCreateSocket();
 }
コード例 #2
0
 /// <summary>
 /// TCP调用客户端
 /// </summary>
 /// <param name="attribute">TCP调用服务器端配置信息</param>
 /// <param name="log">日志接口</param>
 public TcpOpenSimpleClient(AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute attribute = null, AutoCSer.Log.ILog log = null)
 {
     if (attribute == null)
     {
         attribute = AutoCSer.Config.Loader.Get<AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute>("AutoCSer.Example.TcpOpenSimpleServer.Asynchronous") ?? _DefaultServerAttribute_;
         if (attribute.Name == null) attribute.Name = "AutoCSer.Example.TcpOpenSimpleServer.Asynchronous";
     }
     _TcpClient_ = new AutoCSer.Net.TcpOpenSimpleServer.Client<TcpOpenSimpleClient>(this, attribute, log);
     if (attribute.IsAutoClient) _TcpClient_.TryCreateSocket();
 }
 /// <summary>
 /// AutoCSer.Example.TcpOpenSimpleServer.Asynchronous TCP调用服务端
 /// </summary>
 /// <param name="attribute">TCP调用服务器端配置信息</param>
 /// <param name="log">日志接口</param>
 public TcpOpenSimpleServer(AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute attribute = null, Func <System.Net.Sockets.Socket, bool> verify = null, AutoCSer.Log.ILog log = null)
     : base(attribute ?? (attribute = AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute.GetConfig("AutoCSer.Example.TcpOpenSimpleServer.Asynchronous", typeof(AutoCSer.Example.TcpOpenSimpleServer.Asynchronous))), verify, log, false)
 {
     Value = new AutoCSer.Example.TcpOpenSimpleServer.Asynchronous();
     setCommandData(1);
     setCommand(0);
     if (attribute.IsAutoServer)
     {
         Start();
     }
 }
コード例 #4
0
 /// <summary>
 /// AutoCSer.TestCase.TcpOpenSimpleServerPerformance.OpenSimpleServer TCP调用服务端
 /// </summary>
 /// <param name="attribute">TCP调用服务器端配置信息</param>
 /// <param name="value">TCP服务目标对象</param>
 /// <param name="log">日志接口</param>
 public TcpOpenSimpleServer(AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute attribute = null, Func <System.Net.Sockets.Socket, bool> verify = null, AutoCSer.TestCase.TcpOpenSimpleServerPerformance.OpenSimpleServer value = null, AutoCSer.ILog log = null)
     : base(attribute ?? (attribute = AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute.GetConfig("AutoCSer.TestCase.TcpOpenSimpleServerPerformance.OpenSimpleServer", typeof(AutoCSer.TestCase.TcpOpenSimpleServerPerformance.OpenSimpleServer))), verify, log, false)
 {
     Value = value ?? new AutoCSer.TestCase.TcpOpenSimpleServerPerformance.OpenSimpleServer();
     setCommandData(2);
     setCommand(0);
     setCommand(1);
     if (attribute.IsAutoServer)
     {
         Start();
     }
 }
コード例 #5
0
 /// <summary>
 /// TCP调用客户端
 /// </summary>
 /// <param name="attribute">TCP调用服务器端配置信息</param>
 /// <param name="log">日志接口</param>
 public TcpOpenSimpleClient(AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute attribute = null, AutoCSer.ILog log = null)
 {
     if (attribute == null)
     {
         attribute = AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute.GetConfig("AutoCSer.TestCase.TcpOpenSimpleServerPerformance.OpenSimpleServer", typeof(AutoCSer.TestCase.TcpOpenSimpleServerPerformance.OpenSimpleServer));
     }
     _TcpClient_ = new AutoCSer.Net.TcpOpenSimpleServer.Client <TcpOpenSimpleClient>(this, attribute, log);
     if (attribute.IsAutoClient)
     {
         _TcpClient_.TryCreateSocket();
     }
 }
コード例 #6
0
 /// <summary>
 /// TCP调用客户端
 /// </summary>
 /// <param name="attribute">TCP调用服务器端配置信息</param>
 /// <param name="log">日志接口</param>
 public TcpOpenSimpleClient(AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute attribute = null, AutoCSer.Log.ILog log = null)
 {
     if (attribute == null)
     {
         attribute = AutoCSer.Config.Loader.Get <AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute>("AutoCSer.Example.TcpOpenSimpleServer.NoAttribute") ?? AutoCSer.Json.Parser.Parse <AutoCSer.Net.TcpOpenSimpleServer.ServerAttribute>(@"{""CheckSeconds"":59,""ClientSegmentationCopyPath"":null,""ClientSendBufferMaxSize"":0x100000,""GenericType"":null,""Host"":""127.0.0.1"",""IsAttribute"":false,""IsAutoClient"":false,""IsAutoServer"":true,""IsBaseTypeAttribute"":false,""IsCompileSerialize"":true,""IsJsonSerialize"":true,""IsMarkData"":false,""IsSegmentation"":true,""IsSimpleSerialize"":true,""MaxInputSize"":0x3FF4,""MaxVerifyDataSize"":1024,""MemberFilters"":""Instance"",""MinCompressSize"":0,""Name"":null,""Port"":0x33F4,""ReceiveVerifyCommandSeconds"":9,""SendBufferSize"":""Kilobyte8"",""ServerSendBufferMaxSize"":0,""VerifyString"":null,""TypeId"":{}}");
         if (attribute.Name == null)
         {
             attribute.Name = "AutoCSer.Example.TcpOpenSimpleServer.NoAttribute";
         }
     }
     _TcpClient_ = new AutoCSer.Net.TcpOpenSimpleServer.Client <TcpOpenSimpleClient>(this, attribute, log);
     if (attribute.IsAutoClient)
     {
         _TcpClient_.TryCreateSocket();
     }
 }