Ejemplo n.º 1
0
        public MyServerSession(Socket socket, MySocketServer server) : base(socket)
        {
            Handlers.Add(new TransferHandler()
            {
                Server = server
            });

            ServiceClientHandler serviceClientHandler = new ServiceClientHandler();

            ServiceHandler serviceManager = new ServiceHandler();

            Handlers.Add(serviceManager);
            this.Handlers.Add(serviceClientHandler);
            Handlers.Add(new MyServerHandler());


            ICalcback calcCallback = serviceClientHandler.GetServiceProxy <ICalcback>("calcc");

            serviceManager.AddService("calc", new Calc()
            {
                callback = calcCallback
            });

            Calc2 calc2 = new Calc2();

            serviceManager.AddService("calc2", calc2);


            ITermainalCallbackService callback = serviceClientHandler
                                                 .GetServiceProxy <ITermainalCallbackService>("tc");

            serviceManager.AddService("t", new TerminalService(callback));

            serviceManager.AddService("terminal", new TerminalService2());
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            HttpServer httpServer = new HttpServer();

            httpServer.Initialize(8080);

            MySocketServer server = new MySocketServer(new MySocketListener());

            server.Initialize(1234);


            //Form1 form = new Form1();

            //form.Load += (s, e) => {
            //    F();

            //    Print("after f");
            //};

            //Application.EnableVisualStyles();
            //Application.Run(form);


            Console.ReadLine();
        }