Пример #1
0
        /// <summary>
        /// 初始化所有对象,并初始化类
        /// </summary>
        public void Init()
        {
            Client       = new UDPThread(_client);                                //文本网络对象
            LivedHost    = new OnlineHost(this.Config);                           //主机列表
            MessageProxy = new MessageTranslator(Client, this.Config, LivedHost); //文本信息翻译层对象

            //自动查询主机客户端版本
            LivedHost.HostOnline += (s, e) =>
            {
                if (Config.AutoDetectVersion)
                {
                    this.GetVersion(e.Host);
                }
            };

            //文件传输
            FileTaskManager = new FileTaskManager(this.Config);
            FileTaskManager.FileReceiveTaskDiscarded += (s, e) => this.SendReleaseFilesSignal(e.TaskInfo.RemoteHost, e.TaskInfo.PackageID);
            FileTaskModule = new FSLib.IPMessager.Network.TCPThread(_client)
            {
                TaskManager = FileTaskManager
            };


            //与接收消息进行挂钩
            MessageProxy.MessageReceived += MessageProxy_MessageReceived;
        }
Пример #2
0
		/// <summary>
		/// 初始化所有对象,并初始化类
		/// </summary>
		public void Init()
		{
			Client = new UDPThread(_client);			//文本网络对象
			LivedHost = new OnlineHost(this.Config);								//主机列表
			MessageProxy = new MessageTranslator(Client, this.Config, LivedHost);	//文本信息翻译层对象

			//自动查询主机客户端版本
			LivedHost.HostOnline += (s, e) =>
			{
				if (Config.AutoDetectVersion) this.GetVersion(e.Host);
			};

			//文件传输
			FileTaskManager = new FileTaskManager(this.Config);
			FileTaskManager.FileReceiveTaskDiscarded += (s, e) => this.SendReleaseFilesSignal(e.TaskInfo.RemoteHost, e.TaskInfo.PackageID);
			FileTaskModule = new FSLib.IPMessager.Network.TCPThread(_client)
			{
				TaskManager = FileTaskManager
			};


			//与接收消息进行挂钩
			MessageProxy.MessageReceived += MessageProxy_MessageReceived;
		}