Ejemplo n.º 1
0
        public static IFastSocketBuild CreateSocketBuild(FastSocketBuildOption options)
        {
            IFastSocketBuild fastSocketBuild = new FastSocketBuild();

            fastSocketBuild.ConfigureDefaultOptions(options);
            return(fastSocketBuild);
        }
Ejemplo n.º 2
0
 public FastSocket(FastSocketBuildOption option, IFastSocketService fastSocketService)
 {
     this.Ip                    = option.Ip;
     this.Port                  = option.Port;
     this.MaxConnections        = option.MaxConnections;
     this.MaxTimeOutMillisecond = option.MaxTimeOutMillisecond;
     this.MaxTransPortBodyMB    = option.MaxTransPortBodyMB;
     //
     this.Encoding           = Encoding.UTF8;
     this.SocketProtocolType = EnumSocketProtocolType.tcp;
     this.FastSocketService  = fastSocketService;
     Connections             = new LinkedList <FastSocketConnection>();
 }
Ejemplo n.º 3
0
        public static IFastSocketBuild CreateSocketBuild()
        {
            string jsonConfigFilePath    = GetJsonConfigFilePath();
            FastSocketBuildOption option = JsonFileObj.GetJsonObjFromJsonFile <FastSocketBuildOption>(jsonConfigFilePath);

            if (string.IsNullOrWhiteSpace(jsonConfigFilePath))
            {
                return(CreateSocketBuild(new FastSocketBuildOption
                {
                    Ip = "127.0.0.1",
                    Port = 6188,
                    MaxConnections = 2,
                    MaxTimeOutMillisecond = 3000,
                    MaxTransPortBodyMB = 2
                }));
            }
            return(CreateSocketBuild(option));
        }
Ejemplo n.º 4
0
 public void ConfigureDefaultOptions(FastSocketBuildOption options)
 {
     fastSocketBuildOption = options;
 }