using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SuperSocket.SocketBase.Config;
using SuperSocket.SocketBase.Provider;
namespace SuperSocket.SocketBase
{
///
/// An item can be started and stopped
///
public interface IWorkItemBase : IStatusInfoSource, ISystemEndPoint
{
///
/// Gets the name.
///
string Name { get; }
///
/// Gets the server's config.
///
///
/// The server's config.
///
IServerConfig Config { get; }
///
/// Starts this server instance.
///
/// return true if start successfull, else false
bool Start();
///
/// Reports the potential configuration change.
///
/// The server config which may be changed.
void ReportPotentialConfigChange(IServerConfig config);
///
/// Stops this server instance.
///
void Stop();
///
/// Gets the total session count.
///
int SessionCount { get; }
}
///
/// An item can be started and stopped
///
public interface IWorkItem : IWorkItemBase, IStatusInfoSource
{
///
/// Setups with the specified root config.
///
/// The bootstrap.
/// The socket server instance config.
/// The factories.
///
bool Setup(IBootstrap bootstrap, IServerConfig config, ProviderFactoryInfo[] factories);
///
/// Gets the current state of the work item.
///
///
/// The state.
///
ServerState State { get; }
}
}