예제 #1
0
        static void Main(string[] args)
        {
            ServiceManager sm = new ServiceManager();

            SemanticProcessor semproc = new SemanticProcessor();

            semproc.Initialize(sm);
            sm.RegisterSingleton <ISemanticProcessor>(semproc);

            var wsClient = new WebSocketClientService();

            wsClient.Initialize(sm);
            sm.RegisterSingleton <IWebSocketClientService>(wsClient);

            semproc.Register <SocketMembrane, ServerSocketReceiver>();

            // wsClient.Start("ws://127.0.0.1", 1000, "/wstest");
            wsClient.Start("ws://24.105.201.179", 31415, "/wstest");
            // wsClient.Start("ws://emsserver.club", 443, "/wstest");


            // wsClient.Start("wss://24.105.201.179", 443, "/wstest");
            // wsClient.Start("wss://emsserver.club", 443, "/wstest");

            // Console.WriteLine("WS client connected to 127.0.0.1:1000");
            wsClient.Send("Hello World!");
            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            ServiceManager sm = new ServiceManager();

            SemanticProcessor semproc = new SemanticProcessor();

            semproc.Initialize(sm);
            sm.RegisterSingleton <ISemanticProcessor>(semproc);

            wsServer = new WebSocketServerService();
            wsServer.Initialize(sm);
            sm.RegisterSingleton <IWebSocketServerService>(wsServer);

            semproc.Register <SocketMembrane, ServerSocketReceiver>();
            wsServer.Start("127.0.0.1", 1000, "/wstest");

            Console.WriteLine("WS listening on 127.0.0.1:1000");
            Console.ReadLine();
            wsServer.Stop();
        }