public void Test1() { var netronics = new Netronics.Netronics(new Properties()); netronics.Start(); netronics.AddChannel(SocketChannel.CreateChannel(null)); netronics.Stop(); }
static void Main(string[] args) { var properties = Properties.CreateProperties(new IPEndPoint(IPAddress.Any, 7777), ChannelPipe.CreateChannelPipe(Handler)); var netronics = new Netronics.Netronics(properties); netronics.Start(); }
public ServiceManager(string path) { _networkManager = new NetworkManager(path); _processor = new Thread(Processing); _processor.Start(); _netronics = new Netronics.Netronics(this); _netronics.Start(); }
static void Main(string[] args) { // Properties를 생성합니다. Properties는 Netronics의 각종 설정을 의미합니다. var properties = Properties.CreateProperties(new IPEndPoint(IPAddress.Any, 7777), // 클라이언트를 받을 아이피와 포트를 설정합니다. new ChannelPipe(new X509Certificate2("server.pfx", "asdf"))); var netronics = new Netronics.Netronics(properties); // 위에서 만든 Properties를 바탕으로 Netronics 객체를 생성합니다. netronics.Start(); // 서버를 가동합니다. }
static void Main(string[] args) { var properties = new Properties(); properties.SetIpEndPoint(new IPEndPoint(IPAddress.Any, 7777)); properties.SetChannelFactoryOption(factory => SetFactoryOption((ChannelFactory)factory)); var netronics = new Netronics.Netronics(properties); netronics.Start(); ExitEvent.WaitOne(); }
static void Main(string[] args) { // Properties를 생성합니다. Properties는 Netronics의 각종 설정을 의미합니다. var properties = Properties.CreateProperties(new IPEndPoint(IPAddress.Any, 7777), // 클라이언트를 받을 아이피와 포트를 설정합니다. new ChannelPipe().SetCreateChannelAction(channel => // 각 클라이언트가 접속하면 Channel을 생성하는 과정이 시작되는데 옵션을 아래와 같이 넣을 수 있습니다. { channel.SetConfig("encoder", PacketEncoder.Encoder); // 해당 Channel의 Packet Encoder을 설정합니다. channel.SetConfig("decoder", PacketEncoder.Encoder); // 해당 Channel의 Packet Decoder을 설정합니다. channel.SetConfig("handler", new Handler()); // 해당 Channel의 Handler을 설정합니다. })); var netronics = new Netronics.Netronics(properties); // 위에서 만든 Properties를 바탕으로 Netronics 객체를 생성합니다. netronics.Start(); // 서버를 가동합니다. }
static void Main(string[] args) { // 본 설정은 EchoServer Example와 비슷합니다. 자세한 설명을 보고 싶으시면 EchoServer Example을 참고해주세요. var properties = Properties.CreateProperties(new IPEndPoint(IPAddress.Any, 7777), new ChannelPipe().SetCreateChannelAction(channel => { channel.SetConfig("encoder", PacketEncoder.Encoder); channel.SetConfig("decoder", PacketEncoder.Encoder); channel.SetConfig("handler", Handler); })); var netronics = new Netronics.Netronics(properties); netronics.Start(); }
public ManagerProcessor(ServiceLoader loader, string[] host) { _loader = loader; _host = host; _processor = new Thread(Processing); _processor.Start(); _loader.GetService().SetManagerProcessor(this); _loader.GetService().Load(this); _netronics = new Netronics.Netronics(new Properties(new IPEndPoint(IPAddress.Any, 0), () => new Handler.Service(this))); _netronics.Start(); Connect(); _manager = new Client(new Properties(_managerIPEndPoint, () => new Handler.Manager(this))); _manager.Start(); _loader.GetService().Start(); }