Exemple #1
0
        static void Main(string[] args)
        {
            SocketsServer s = new SocketsServer(8000);
            s.StartServing();

            Binding binding = new CustomBinding(new SizedTcpDuplexTransportBindingElement());
            string address = SizedTcpDuplexTransportBindingElement.SizedTcpScheme + "://localhost:8000";
            ChannelFactory<ITypedTest> factory = new ChannelFactory<ITypedTest>(binding, new EndpointAddress(address));
            ITypedTest proxy = factory.CreateChannel();

            Console.WriteLine(proxy.Add(4, 5));
            Console.WriteLine(proxy.Subtract(44, 66));

            s.StopServing();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            SocketsServer s = new SocketsServer(8000);

            s.StartServing();

            Binding binding = new CustomBinding(new SizedTcpDuplexTransportBindingElement());
            string  address = SizedTcpDuplexTransportBindingElement.SizedTcpScheme + "://localhost:8000";
            ChannelFactory <ITypedTest> factory = new ChannelFactory <ITypedTest>(binding, new EndpointAddress(address));
            ITypedTest proxy = factory.CreateChannel();

            Console.WriteLine(proxy.Add(4, 5));
            Console.WriteLine(proxy.Subtract(44, 66));

            s.StopServing();
        }