summaryrefslogtreecommitdiff
path: root/tutorial/netstd
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2019-11-20 19:03:14 +0100
committerJens Geyer <jensg@apache.org>2019-11-23 01:15:45 +0100
commiteacd1d48c85ea756fd5edd10d7c328ee11a0657f (patch)
tree267b5a03536859d2554611fc0130dd3bd6480013 /tutorial/netstd
parent8ae80a7f8466e5c340388fcb1d797dc3779d9f80 (diff)
downloadthrift-eacd1d48c85ea756fd5edd10d7c328ee11a0657f.tar.gz
THRIFT-5021 Implement MAX_MESSAGE_SIZE and centralize limits into a TConfiguration class
Client: netstd Patch: Jens Geyer This closes #1943
Diffstat (limited to 'tutorial/netstd')
-rw-r--r--tutorial/netstd/Client/Program.cs12
-rw-r--r--tutorial/netstd/Server/Program.cs8
2 files changed, 12 insertions, 8 deletions
diff --git a/tutorial/netstd/Client/Program.cs b/tutorial/netstd/Client/Program.cs
index f9509fa2d..857b3e808 100644
--- a/tutorial/netstd/Client/Program.cs
+++ b/tutorial/netstd/Client/Program.cs
@@ -40,6 +40,7 @@ namespace Client
{
private static ServiceCollection ServiceCollection = new ServiceCollection();
private static ILogger Logger;
+ private static readonly TConfiguration Configuration = null; // new TConfiguration() if needed
private static void DisplayHelp()
{
@@ -143,7 +144,7 @@ Sample:
private static TTransport GetTransport(string[] args)
{
- TTransport transport = new TSocketTransport(IPAddress.Loopback, 9090);
+ TTransport transport = new TSocketTransport(IPAddress.Loopback, 9090, Configuration);
// construct endpoint transport
var transportArg = args.FirstOrDefault(x => x.StartsWith("-tr"))?.Split(':')?[1];
@@ -152,19 +153,20 @@ Sample:
switch (selectedTransport)
{
case Transport.Tcp:
- transport = new TSocketTransport(IPAddress.Loopback, 9090);
+ transport = new TSocketTransport(IPAddress.Loopback, 9090, Configuration);
break;
case Transport.NamedPipe:
- transport = new TNamedPipeTransport(".test");
+ transport = new TNamedPipeTransport(".test", Configuration);
break;
case Transport.Http:
- transport = new THttpTransport(new Uri("http://localhost:9090"), null);
+ transport = new THttpTransport(new Uri("http://localhost:9090"), Configuration);
break;
case Transport.TcpTls:
- transport = new TTlsSocketTransport(IPAddress.Loopback, 9090, GetCertificate(), CertValidator, LocalCertificateSelectionCallback);
+ transport = new TTlsSocketTransport(IPAddress.Loopback, 9090, Configuration,
+ GetCertificate(), CertValidator, LocalCertificateSelectionCallback);
break;
default:
diff --git a/tutorial/netstd/Server/Program.cs b/tutorial/netstd/Server/Program.cs
index e1dab01e0..c1e0cb3ec 100644
--- a/tutorial/netstd/Server/Program.cs
+++ b/tutorial/netstd/Server/Program.cs
@@ -44,6 +44,7 @@ namespace Server
{
private static ServiceCollection ServiceCollection = new ServiceCollection();
private static ILogger Logger;
+ private static readonly TConfiguration Configuration = null; // new TConfiguration() if needed
public static void Main(string[] args)
{
@@ -163,13 +164,14 @@ Sample:
switch (transport)
{
case Transport.Tcp:
- serverTransport = new TServerSocketTransport(9090);
+ serverTransport = new TServerSocketTransport(9090, Configuration);
break;
case Transport.NamedPipe:
- serverTransport = new TNamedPipeServerTransport(".test");
+ serverTransport = new TNamedPipeServerTransport(".test", Configuration);
break;
case Transport.TcpTls:
- serverTransport = new TTlsServerSocketTransport(9090, GetCertificate(), ClientCertValidator, LocalCertificateSelectionCallback);
+ serverTransport = new TTlsServerSocketTransport(9090, Configuration,
+ GetCertificate(), ClientCertValidator, LocalCertificateSelectionCallback);
break;
}