static void Main(string[] args) { var certificate = new X509Certificate2("GriffinNetworkingTemp.pfx", "mamma"); var config = new LiteServerConfiguration(); config.Modules.AddAuthentication(new HashAuthenticationModule(new FakeFetcher())); config.Modules.AddAuthorization(new MustAlwaysAuthenticate()); var server = new LiteServer(config); server.Start(IPAddress.Loopback, 0); var client = new CqsClient(() => new DataContractMessageSerializer()); client.Authenticator = new HashClientAuthenticator(new NetworkCredential("jonas", "mamma")); client.StartAsync(IPAddress.Loopback, server.LocalPort).Wait(); client.ExecuteAsync(new HelloWorld()).Wait(); var listener = new HttpListener(); listener.ChannelFactory = new SecureTcpChannelFactory(new ServerSideSslStreamBuilder(certificate)); listener.ClientConnected += OnConnect; listener.MessageReceived = OnMessage; listener.BodyDecoder = new CompositeIMessageSerializer(); listener.Start(IPAddress.Any, 8083); Console.ReadLine(); }
static void Main(string[] args) { var certificate = new X509Certificate2("GriffinNetworkingTemp.pfx", "mamma"); var config = new LiteServerConfiguration(); config.Modules.AddAuthentication(new HashAuthenticationModule(new FakeFetcher())); config.Modules.AddAuthorization(new MustAlwaysAuthenticate()); var server = new LiteServer(config); server.Start(IPAddress.Loopback, 0); var client = new CqsClient(() => new DataContractMessageSerializer()); client.Authenticator = new HashClientAuthenticator(new NetworkCredential("jonas", "mamma")); client.StartAsync(IPAddress.Loopback, server.LocalPort).Wait(); client.ExecuteAsync(new HelloWorld()).Wait(); var listener = new HttpListener(); listener.ChannelFactory = new SecureTcpChannelFactory(new ServerSideSslStreamBuilder(certificate)); listener.ClientConnected += OnConnect; listener.MessageReceived = OnMessage; listener.BodyDecoder = new CompositeIMessageSerializer(); listener.Start(IPAddress.Any, 8083); Console.ReadLine(); }
static void Main(string[] args) { var server = CreateServer(); server.Start(IPAddress.Any, 0); var client = new CqsClient(() => new JsonMessageSerializer()); client.StartAsync(IPAddress.Loopback, server.LocalPort).Wait(); client.ExecuteAsync(new IncreaseDiscount(1)).Wait(); Console.ReadLine(); }
static void Main(string[] args) { var server = CreateServer(); server.Start(IPAddress.Any, 0); var client = new CqsClient(() => new JsonMessageSerializer()); client.StartAsync(IPAddress.Loopback, server.LocalPort).Wait(); client.ExecuteAsync(new IncreaseDiscount(1)).Wait(); Console.ReadLine(); }
public ClientDemo() { _client = new CqsClient(() => new JsonMessageSerializer()); }