diff --git a/README.md b/README.md index f381e72..cf1df9b 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ and the same should be added in the block. This requires that a suitable keystore with a valid certificate is provided. See the configuration details in the [provided template](https://lightstreamer.com/docs/ls-server/latest/remote_adapter_robust_conf_template/adapters.xml). NOTE: For your experiments, you can configure the adapters.xml to use the same JKS keystore "myserver.keystore" provided out of the box in the Lightstreamer distribution. Since this keystore contains an invalid certificate, remember to configure your local environment to "trust" it. The sample Remote Server provided in the `Deployment_DotNet_Adapters` directory in `deploy.zip` is already predisposed for TLS connection on all ports. You can rerun the demo with the new configuration after modifying DotNetStockListDemoLauncher.bat to run a command like this:
- `dotnet TestAdapter.dll /host xxxxxxxx /tls /data_rrport 6661 /data_notifport 6662 /metadata_rrport 6663 max_bandwidth=40 max_frequency=3 buffer_size=30`
+ `dotnet TestAdapter.dll /host xxxxxxxx /tls /data_rrport 6661 /metadata_rrport 6663 max_bandwidth=40 max_frequency=3 buffer_size=30`
where the same hostname supported by the provided certificate must be supplied. #### Add Authentication @@ -99,7 +99,7 @@ and the same should be added in the block. See the configuration details in the [provided template](https://lightstreamer.com/docs/ls-server/latest/remote_adapter_robust_conf_template/adapters.xml). The sample Remote Server provided in the `Deployment_DotNet_Adapters` directory in `deploy.zip` is already predisposed for credential submission on both adapters. You can rerun the demo with the new configuration after modifying DotNetStockListDemoLauncher.bat to run a command like this:
- `dotnet TestAdapter.dll /host localhost /user user1 /password pwd1 /data_rrport 6661 /data_notifport 6662 /metadata_rrport 6663 max_bandwidth=40 max_frequency=3 buffer_size=30`
+ `dotnet TestAdapter.dll /host localhost /user user1 /password pwd1 /data_rrport 6661 /metadata_rrport 6663 max_bandwidth=40 max_frequency=3 buffer_size=30`
Authentication can (and should) be combined with TLS encryption. @@ -145,5 +145,8 @@ To build your own version of the Remote Server, follow these steps: ## Lightstreamer Compatibility Notes -* Compatible with Lightstreamer SDK for .NET Standard Adapters version 1.15 and newer. -* For instructions compatible with Lightstreamer SDK for .NET Adapters version 1.11, please refer to [this tag](https://github.com/Lightstreamer/Lightstreamer-example-StockList-adapter-dotnet/releases/tag/for_standard_1.11). +* Compatible with Lightstreamer SDK for .NET Standard Adapters version 1.15 or newer and Lightstreamer Server version 7.4 or newer. +- For a version of this example compatible with Lightstreamer Server version since 7.0, please refer to [this tag](https://github.com/Lightstreamer/Lightstreamer-example-StockList-adapter-dotnet/tree/for_Lightstreamer_7.3). +- For instructions compatible with Lightstreamer SDK for .NET Standard Adapters version 1.12 to 1.14, please refer to [this tag](https://github.com/Lightstreamer/Lightstreamer-example-StockList-adapter-dotnet/releases/tree/for_Lightstreamer_7.3). +- For instructions compatible with Lightstreamer SDK for .NET Adapters version 1.11, please refer to [this tag](https://github.com/Lightstreamer/Lightstreamer-example-StockList-adapter-dotnet/releases/tag/for_standard_1.11). + diff --git a/src/src_standalone_launcher/StandaloneLauncher.cs b/src/src_standalone_launcher/StandaloneLauncher.cs index 75947aa..f7fa12c 100644 --- a/src/src_standalone_launcher/StandaloneLauncher.cs +++ b/src/src_standalone_launcher/StandaloneLauncher.cs @@ -27,7 +27,6 @@ class StandaloneLauncher public const string ARG_TLS = "tls"; // will use lowercase public const string ARG_METADATA_RR_PORT = "metadata_rrport"; public const string ARG_DATA_RR_PORT = "data_rrport"; - public const string ARG_DATA_NOTIF_PORT = "data_notifport"; public const string ARG_USER = "user"; public const string ARG_PASSWORD = "password"; public const string ARG_NAME = "name"; @@ -55,7 +54,6 @@ public static void Main(string[] args) bool isTls = false; int rrPortMD = -1; int rrPortD = -1; - int notifPortD = -1; string username = null; string password = null; string name = null; @@ -98,13 +96,6 @@ public static void Main(string[] args) nLog.Debug("Found argument: '" + ARG_DATA_RR_PORT + "' with value: '" + rrPortD + "'"); } - else if (arg.Equals(ARG_DATA_NOTIF_PORT)) - { - i++; - notifPortD = Int32.Parse(args[i]); - - nLog.Debug("Found argument: '" + ARG_DATA_NOTIF_PORT + "' with value: '" + notifPortD + "'"); - } else if (arg.Equals(ARG_USER)) { i++; @@ -166,7 +157,7 @@ public static void Main(string[] args) } nLog.Debug("Remote Metadata Adapter initialized"); - ServerStarter starter = new ServerStarter(host, isTls, rrPortMD, -1); + ServerStarter starter = new ServerStarter(host, isTls, rrPortMD); starter.Launch(server); } @@ -183,7 +174,7 @@ public static void Main(string[] args) } nLog.Debug("Remote Data Adapter initialized"); - ServerStarter starter = new ServerStarter(host, isTls, rrPortD, notifPortD); + ServerStarter starter = new ServerStarter(host, isTls, rrPortD); starter.Launch(server); } } @@ -201,24 +192,22 @@ private static void Help() nLog.Fatal("Usage: DotNetStockListDemoLauncher"); nLog.Fatal(" [/name ]"); nLog.Fatal(" /host
[/tls]"); - nLog.Fatal(" /metadata_rrport /data_rrport /data_notifport "); + nLog.Fatal(" /metadata_rrport /data_rrport "); nLog.Fatal(" [/user /password ]"); nLog.Fatal(" [\"=\" ... \"=\"]"); nLog.Fatal("Where: is the symbolic name for both the adapters (1)"); nLog.Fatal("
is the host name or ip address of LS server (2)"); - nLog.Fatal(" is the tcp port number where LS proxy is listening on (3)"); - nLog.Fatal(" /tls if indicated, initiates a TLS-encrypted communication (4)"); - nLog.Fatal(" is sent, along with , to the LS proxy (4)"); - nLog.Fatal(" is the Nth metadata adapter parameter name (5)"); - nLog.Fatal(" is the value of the Nth metadata adapter parameter (5)"); + nLog.Fatal(" is a tcp port number where LS proxy is listening on"); + nLog.Fatal(" /tls if indicated, initiates a TLS-encrypted communication (3)"); + nLog.Fatal(" is sent, along with , to the LS proxy (3)"); + nLog.Fatal(" is the Nth metadata adapter parameter name (4)"); + nLog.Fatal(" is the value of the Nth metadata adapter parameter (4)"); nLog.Fatal("Notes: (1) The adapter name is optional, if it is not given the adapter will be"); nLog.Fatal(" assigned a progressive number name like \"#1\", \"#2\" and so on"); nLog.Fatal(" (2) The communication will be from here to LS, not viceversa"); - nLog.Fatal(" (3) The notification port is necessary for a Data Adapter, while it is"); - nLog.Fatal(" not needed for a Metadata Adapter"); - nLog.Fatal(" (4) TLS communication and user-password submission may or may not be needed"); + nLog.Fatal(" (3) TLS communication and user-password submission may or may not be needed"); nLog.Fatal(" depending on the LS Proxy Adapter configuration"); - nLog.Fatal(" (5) The parameters name/value pairs will be passed to the LiteralBasedProvider"); + nLog.Fatal(" (4) The parameters name/value pairs will be passed to the LiteralBasedProvider"); nLog.Fatal(" Metadata Adapter as a Hashtable in the \"parameters\" Init() argument"); nLog.Fatal(" The StockListDemo Data Adapter requires no parameters"); nLog.Fatal("Aborting..."); @@ -237,14 +226,12 @@ public class ServerStarter : IExceptionHandler private string _host; private bool _isTls; private int _rrPort; - private int _notifPort; - public ServerStarter(string host, bool isTls, int rrPort, int notifPort) + public ServerStarter(string host, bool isTls, int rrPort) { _host = host; _isTls = isTls; _rrPort = rrPort; - _notifPort = notifPort; } public void Launch(Server server) @@ -259,7 +246,6 @@ public void Launch(Server server) public void Run() { TcpClient _rrSocket = null; - TcpClient _notifSocket = null; do { @@ -268,11 +254,6 @@ public void Run() try { _rrSocket = CreateSocket(_host, _isTls, _rrPort); - if (_notifPort >= 0) - { - _notifSocket = CreateSocket(_host, _isTls, _notifPort); - } - nLog.Info("Connected"); break; @@ -280,7 +261,6 @@ public void Run() catch (SocketException) { nLog.Info("Connection failed, retrying in 10 seconds..."); - Thread.Sleep(10000); } @@ -291,12 +271,6 @@ public void Run() Stream _rrStream = GetProperStream(_rrSocket, _rrPort); _server.RequestStream = _rrStream; _server.ReplyStream = _rrStream; - - if (_notifSocket != null) - { - Stream _notifStream = GetProperStream(_notifSocket, _notifPort); - _server.NotifyStream = _notifStream; - } } catch (AuthenticationException e) {