mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-08 01:04:47 +00:00
Touch-ups on autoreconnect
This commit is contained in:
@@ -32,6 +32,12 @@ namespace PepperDash.Core
|
||||
/// </summary>
|
||||
public IBasicCommunication Port { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default false. If true, the delimiter will be included in the line output
|
||||
/// events
|
||||
/// </summary>
|
||||
public bool IncludeDelimiter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// For receive buffer
|
||||
/// </summary>
|
||||
@@ -92,7 +98,14 @@ namespace PepperDash.Core
|
||||
if (lines.Length > 0)
|
||||
{
|
||||
for (int i = 0; i < lines.Length - 1; i++)
|
||||
handler(this, new GenericCommMethodReceiveTextArgs(lines[i]));
|
||||
{
|
||||
string strToSend = null;
|
||||
if (IncludeDelimiter)
|
||||
strToSend = lines[i] + Delimiter;
|
||||
else
|
||||
strToSend = lines[i];
|
||||
handler(this, new GenericCommMethodReceiveTextArgs(strToSend));
|
||||
}
|
||||
ReceiveBuffer = new StringBuilder(lines[lines.Length - 1]);
|
||||
}
|
||||
}
|
||||
@@ -117,7 +130,14 @@ namespace PepperDash.Core
|
||||
if (lines.Length > 1)
|
||||
{
|
||||
for (int i = 0; i < lines.Length - 1; i++)
|
||||
handler(this, new GenericCommMethodReceiveTextArgs(lines[i]));
|
||||
{
|
||||
string strToSend = null;
|
||||
if (IncludeDelimiter)
|
||||
strToSend = lines[i] + StringDelimiter;
|
||||
else
|
||||
strToSend = lines[i];
|
||||
handler(this, new GenericCommMethodReceiveTextArgs(strToSend));
|
||||
}
|
||||
ReceiveBuffer = new StringBuilder(lines[lines.Length - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace PepperDash.Core
|
||||
public bool AutoReconnect { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Milliseconds to wait before attempting to reconnect. Defaults to 5000
|
||||
/// </summary>
|
||||
public int AutoReconnectIntervalMs { get; set; }
|
||||
|
||||
@@ -98,6 +98,7 @@ namespace PepperDash.Core
|
||||
return;
|
||||
}
|
||||
}
|
||||
AutoReconnectIntervalMs = 5000;
|
||||
|
||||
Client = new TCPClient(address, port, bufferSize);
|
||||
Client.SocketStatusChange += Client_SocketStatusChange;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -10,8 +10,8 @@
|
||||
<ArchiveName />
|
||||
</RequiredInfo>
|
||||
<OptionalInfo>
|
||||
<CompiledOn>10/18/2016 12:34:49 PM</CompiledOn>
|
||||
<CompilerRev>1.0.0.20775</CompilerRev>
|
||||
<CompiledOn>11/9/2016 5:41:14 PM</CompiledOn>
|
||||
<CompilerRev>1.0.0.31834</CompilerRev>
|
||||
</OptionalInfo>
|
||||
<Plugin>
|
||||
<Version>Crestron.SIMPLSharp, Version=2.0.48.0, Culture=neutral, PublicKeyToken=812d080f93e2de10</Version>
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
MainAssembly=PepperDash_Core.dll:59ea04ece7016e5dd5cfbefdb88bb5ab
|
||||
MainAssembly=PepperDash_Core.dll:5bffbd7a7e3b0acd31ccd19249863216
|
||||
MainAssemblyMinFirmwareVersion=1.007.0017
|
||||
MainAssemblyResource=SimplSharpData.dat:315526abf906cded47fb0c7510266a7e
|
||||
ü
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user