using IpcLibrary.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IpcLibrary.Server {
///
/// IPC服务器工厂
///
public static class IPCServerFactory {
///
/// 创建默认配置的服务器
///
public static IIPCServer CreateServer() {
return new IPCServer();
}
///
/// 创建自定义配置的服务器
///
public static IIPCServer CreateServer(IPCConfiguration configuration) {
return new IPCServer(configuration);
}
///
/// 创建并启动服务器
///
public static async Task CreateAndStartAsync(string address, IPCConfiguration configuration = null) {
var server = new IPCServer(configuration);
await server.StartAsync(address);
return server;
}
}
}