Files
inside_out_web_data_interac…/94_wai/Getf.Service.Transfer.WinService/Service1.cs
2021-12-20 17:17:49 +08:00

50 lines
1.0 KiB
C#

using Getf.Service.Transfer.Core;
using SuperSocket.SocketEngine;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
namespace Getf.Service.Transfer.WinService
{
public partial class Service1 : ServiceBase
{
private Server _Server;
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
/*var ipInfo = System.Configuration.ConfigurationManager.AppSettings["IpInfo"].Split(':');
_Server = new Server();
if (ipInfo[0] != String.Empty)
{
_Server.Setup(ipInfo[0], int.Parse(ipInfo[1]));
}
else
{
_Server.Setup(int.Parse(ipInfo[1]));
}
_Server.Start();*/
var boostrap = BootstrapFactory.CreateBootstrap();
boostrap.Initialize();
boostrap.Start();
}
protected override void OnStop()
{
_Server.Stop();
_Server.Dispose();
_Server = null;
}
}
}