Skip to content

Commit 721ce78

Browse files
authored
Infinity receiving mode (#15)
* Upgrade installed to new version * Infinity receiving mode
1 parent 8bccb48 commit 721ce78

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

installer/CliNetliteInstaller/CliNetliteInstaller.wixproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ProductVersion>3.10</ProductVersion>
77
<ProjectGuid>f13fb7ef-d892-4229-a1eb-8b595d71d64e</ProjectGuid>
88
<SchemaVersion>2.0</SchemaVersion>
9-
<OutputName>cli-netlite-2.1.4</OutputName>
9+
<OutputName>cli-netlite-2.1.5</OutputName>
1010
<OutputType>Package</OutputType>
1111
</PropertyGroup>
1212
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">

installer/CliNetliteInstaller/Product.wxs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<?define version="2.1.4"?>
2+
<?define version="2.1.5"?>
33
<?define UpgradeCode="a580c04f-caec-4e18-9134-c4b8f1c8f1be"?>
44
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
55
<Product Id="*"
@@ -54,6 +54,9 @@
5454
<Component Id="Amqp.Net.dll">
5555
<File Id="Amqp.Net.dll" Source="..\..\src\dotNet\ClientLib\bin\Debug\Amqp.Net.dll" KeyPath="yes" Checksum="yes"/>
5656
</Component>
57+
<Component Id="System.ValueTuple.dll">
58+
<File Id="System.ValueTuple.dll" Source="..\..\src\dotNet\ClientLib\bin\Debug\System.ValueTuple.dll" KeyPath="yes" Checksum="yes"/>
59+
</Component>
5760
<Component Id="SetEnvPath"
5861
Guid="{016cb18d-0357-425b-90a8-caf1826ddee6}">
5962
<CreateFolder />
@@ -69,6 +72,7 @@
6972
<ComponentRef Id="SenderExe" />
7073
<ComponentRef Id="ReceiverExe" />
7174
<ComponentRef Id="ConnectorExe"/>
75+
<ComponentRef Id="System.ValueTuple.dll"/>
7276
</Feature>
7377
</Fragment>
7478

src/dotNet/ClientLib/OptionsParser.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public abstract class BasicOptions : LinkOptions
141141
public int CloseSleep { get; protected set; }
142142
public string SyncMode { get; protected set; }
143143
public TimeSpan Timeout { get; protected set; }
144+
public bool isInfinityReceiving { get; protected set; }
144145
public string LogMsgs { get; protected set; }
145146
public string LogStats { get; protected set; }
146147
public string LogLib { get; protected set; }
@@ -157,6 +158,7 @@ public BasicOptions() : base()
157158
this.CloseSleep = 0;
158159
this.SyncMode = "none";
159160
this.Timeout = TimeSpan.FromSeconds(1);
161+
this.isInfinityReceiving = false;
160162
this.LogMsgs = "upstream";
161163
this.LogStats = String.Empty;
162164
this.LogLib = String.Empty;
@@ -169,7 +171,15 @@ public BasicOptions() : base()
169171
this.Add("sync-mode=", "sync action",
170172
(string syncMode) => { this.SyncMode = syncMode; });
171173
this.Add("t|timeout=", "timeout",
172-
(int timeout) => { this.Timeout = TimeSpan.FromSeconds(timeout); });
174+
(int timeout) => {
175+
if (timeout == -1)
176+
{
177+
this.Timeout = TimeSpan.FromDays(100);
178+
this.isInfinityReceiving = true;
179+
}
180+
else
181+
this.Timeout = TimeSpan.FromSeconds(timeout);
182+
});
173183
this.Add("log-msgs=", "log messages output [dict|body|upstream|interop]",
174184
(string logMsgs) => { this.LogMsgs = logMsgs; });
175185
this.Add("log-stats=", "report various statistic/debug information [endpoint]",

src/dotNet/ClientLib/ReceiverClient.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,17 @@ private void ReceiveAll(ReceiverLink receiver, ReceiverOptions options)
188188
{
189189
Message message = null;
190190

191-
while ((message = receiver.Receive(options.Timeout)) != null)
191+
while ((message = receiver.Receive(options.Timeout)) != null || options.isInfinityReceiving)
192192
{
193-
Formatter.LogMessage(message, options);
194-
Utils.TsSnapStore(this.ptsdata, 'F', options.LogStats);
195-
196-
if (!String.IsNullOrEmpty(options.MsgSelector))
193+
if (message != null)
197194
{
198-
receiver.Accept(message);
195+
Formatter.LogMessage(message, options);
196+
Utils.TsSnapStore(this.ptsdata, 'F', options.LogStats);
197+
198+
if (!String.IsNullOrEmpty(options.MsgSelector))
199+
{
200+
receiver.Accept(message);
201+
}
199202
}
200203
}
201204
}
@@ -338,7 +341,7 @@ public void Run(string[] args)
338341
bool tx_batch_flag = String.IsNullOrEmpty(options.TxLoopendAction) ? (options.TxSize > 0) : true;
339342

340343
//receiving of messages
341-
if (options.RecvBrowse || !String.IsNullOrEmpty(options.MsgSelector))
344+
if (options.RecvBrowse || !String.IsNullOrEmpty(options.MsgSelector) || options.isInfinityReceiving)
342345
this.ReceiveAll(receiver, options);
343346
else
344347
{

0 commit comments

Comments
 (0)