using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TouchSocket.Core;
namespace TouchSocket.Sockets
{
///
/// ServicePlugin
///
public class ServicePlugin : PluginBase, IServicePlugin
{
///
protected virtual void OnStarted(TService sender, ServiceStateEventArgs e)
{
}
///
protected virtual Task OnStartedAsync(TService sender, ServiceStateEventArgs e)
{
return EasyTask.CompletedTask;
}
///
protected virtual void OnStoped(TService sender, ServiceStateEventArgs e)
{
}
///
protected virtual Task OnStopedAsync(TService sender, ServiceStateEventArgs e)
{
return EasyTask.CompletedTask;
}
void IServicePlugin.OnStarted(object sender, ServiceStateEventArgs e)
{
this.OnStarted((TService)sender, e);
}
Task IServicePlugin.OnStartedAsync(object sender, ServiceStateEventArgs e)
{
return this.OnStartedAsync((TService)sender, e);
}
void IServicePlugin.OnStoped(object sender, ServiceStateEventArgs e)
{
this.OnStoped((TService)sender, e);
}
Task IServicePlugin.OnStopedAsync(object sender, ServiceStateEventArgs e)
{
return this.OnStopedAsync((TService)sender, e);
}
}
///
/// TcpServicePlugin
///
public class TcpServicePlugin : ServicePlugin
{
}
///
/// UdpServicePlugin
///
public class UdpServicePlugin : ServicePlugin
{
}
}