mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-16 21:24:43 +00:00
Merged in maintenance/PR-17 (pull request #17)
Maintenance/PR-17 Approved-by: Neil Dorin <ndorin@pepperdash.com>
This commit is contained in:
Binary file not shown.
Binary file not shown.
2137
CLZ Builds/PepperDash_Core.xml
Normal file
2137
CLZ Builds/PepperDash_Core.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -328,6 +328,7 @@ namespace PepperDash.Core
|
|||||||
|
|
||||||
Client = new SecureTCPClient(Hostname, Port, BufferSize);
|
Client = new SecureTCPClient(Hostname, Port, BufferSize);
|
||||||
Client.SocketStatusChange += Client_SocketStatusChange;
|
Client.SocketStatusChange += Client_SocketStatusChange;
|
||||||
|
if(HeartbeatEnabled)
|
||||||
Client.SocketSendOrReceiveTimeOutInMs = (HeartbeatInterval * 5);
|
Client.SocketSendOrReceiveTimeOutInMs = (HeartbeatInterval * 5);
|
||||||
Client.AddressClientConnectedTo = Hostname;
|
Client.AddressClientConnectedTo = Hostname;
|
||||||
Client.PortNumber = Port;
|
Client.PortNumber = Port;
|
||||||
@@ -381,6 +382,15 @@ namespace PepperDash.Core
|
|||||||
//OnClientReadyForcommunications(false); // Should send false event
|
//OnClientReadyForcommunications(false); // Should send false event
|
||||||
}, 15000);
|
}, 15000);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//CLient connected and shared key is not required so just raise the ready for communication event. if Shared key
|
||||||
|
//required this is called by the shared key being negotiated
|
||||||
|
if (IsReadyForCommunication == false)
|
||||||
|
{
|
||||||
|
OnClientReadyForcommunications(true); // Key not required
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -499,14 +509,8 @@ namespace PepperDash.Core
|
|||||||
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Shared key confirmed. Ready for communication");
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Shared key confirmed. Ready for communication");
|
||||||
OnClientReadyForcommunications(true); // Successful key exchange
|
OnClientReadyForcommunications(true); // Successful key exchange
|
||||||
}
|
}
|
||||||
else if (SharedKeyRequired == false && IsReadyForCommunication == false)
|
|
||||||
{
|
|
||||||
OnClientReadyForcommunications(true); // Key not required
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
//var bytesHandler = BytesReceived;
|
//var bytesHandler = BytesReceived;
|
||||||
//if (bytesHandler != null)
|
//if (bytesHandler != null)
|
||||||
// bytesHandler(this, new GenericCommMethodReceiveBytesArgs(bytes));
|
// bytesHandler(this, new GenericCommMethodReceiveBytesArgs(bytes));
|
||||||
|
|||||||
@@ -384,6 +384,7 @@ namespace PepperDash.Core
|
|||||||
if (SecureServer == null)
|
if (SecureServer == null)
|
||||||
{
|
{
|
||||||
SecureServer = new SecureTCPServer(Port, MaxClients);
|
SecureServer = new SecureTCPServer(Port, MaxClients);
|
||||||
|
if(HeartbeatRequired)
|
||||||
SecureServer.SocketSendOrReceiveTimeOutInMs = (this.HeartbeatRequiredIntervalMs * 5);
|
SecureServer.SocketSendOrReceiveTimeOutInMs = (this.HeartbeatRequiredIntervalMs * 5);
|
||||||
SecureServer.HandshakeTimeout = 30;
|
SecureServer.HandshakeTimeout = 30;
|
||||||
SecureServer.SocketStatusChange += new SecureTCPServerSocketStatusChangeEventHandler(SecureServer_SocketStatusChange);
|
SecureServer.SocketStatusChange += new SecureTCPServerSocketStatusChangeEventHandler(SecureServer_SocketStatusChange);
|
||||||
|
|||||||
@@ -328,6 +328,7 @@ namespace PepperDash.Core
|
|||||||
|
|
||||||
Client = new TCPClient(Hostname, Port, BufferSize);
|
Client = new TCPClient(Hostname, Port, BufferSize);
|
||||||
Client.SocketStatusChange += Client_SocketStatusChange;
|
Client.SocketStatusChange += Client_SocketStatusChange;
|
||||||
|
if(HeartbeatEnabled)
|
||||||
Client.SocketSendOrReceiveTimeOutInMs = (HeartbeatInterval * 5);
|
Client.SocketSendOrReceiveTimeOutInMs = (HeartbeatInterval * 5);
|
||||||
Client.AddressClientConnectedTo = Hostname;
|
Client.AddressClientConnectedTo = Hostname;
|
||||||
Client.PortNumber = Port;
|
Client.PortNumber = Port;
|
||||||
@@ -381,6 +382,15 @@ namespace PepperDash.Core
|
|||||||
//OnClientReadyForcommunications(false); // Should send false event
|
//OnClientReadyForcommunications(false); // Should send false event
|
||||||
}, 15000);
|
}, 15000);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//CLient connected and shared key is not required so just raise the ready for communication event. if Shared key
|
||||||
|
//required this is called by the shared key being negotiated
|
||||||
|
if (IsReadyForCommunication == false)
|
||||||
|
{
|
||||||
|
OnClientReadyForcommunications(true); // Key not required
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -485,7 +495,6 @@ namespace PepperDash.Core
|
|||||||
Debug.Console(2, this, "Client Received:\r--------\r{0}\r--------", str);
|
Debug.Console(2, this, "Client Received:\r--------\r{0}\r--------", str);
|
||||||
if (!string.IsNullOrEmpty(checkHeartbeat(str)))
|
if (!string.IsNullOrEmpty(checkHeartbeat(str)))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (SharedKeyRequired && str == "SharedKey:")
|
if (SharedKeyRequired && str == "SharedKey:")
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Server asking for shared key, sending");
|
Debug.Console(1, this, "Server asking for shared key, sending");
|
||||||
@@ -494,19 +503,11 @@ namespace PepperDash.Core
|
|||||||
else if (SharedKeyRequired && str == "Shared Key Match")
|
else if (SharedKeyRequired && str == "Shared Key Match")
|
||||||
{
|
{
|
||||||
StopWaitForSharedKeyTimer();
|
StopWaitForSharedKeyTimer();
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Shared key confirmed. Ready for communication");
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Shared key confirmed. Ready for communication");
|
||||||
OnClientReadyForcommunications(true); // Successful key exchange
|
OnClientReadyForcommunications(true); // Successful key exchange
|
||||||
}
|
}
|
||||||
else if (SharedKeyRequired == false && IsReadyForCommunication == false)
|
|
||||||
{
|
|
||||||
OnClientReadyForcommunications(true); // Key not required
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
//var bytesHandler = BytesReceived;
|
//var bytesHandler = BytesReceived;
|
||||||
//if (bytesHandler != null)
|
//if (bytesHandler != null)
|
||||||
// bytesHandler(this, new GenericCommMethodReceiveBytesArgs(bytes));
|
// bytesHandler(this, new GenericCommMethodReceiveBytesArgs(bytes));
|
||||||
@@ -698,6 +699,7 @@ namespace PepperDash.Core
|
|||||||
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Socket status change: {0} ({1})", client.ClientStatus, (ushort)(client.ClientStatus));
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Socket status change: {0} ({1})", client.ClientStatus, (ushort)(client.ClientStatus));
|
||||||
|
|
||||||
OnConnectionChange();
|
OnConnectionChange();
|
||||||
|
|
||||||
// The client could be null or disposed by this time...
|
// The client could be null or disposed by this time...
|
||||||
if (Client == null || Client.ClientStatus != SocketStatus.SOCKET_STATUS_CONNECTED)
|
if (Client == null || Client.ClientStatus != SocketStatus.SOCKET_STATUS_CONNECTED)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -384,6 +384,7 @@ namespace PepperDash.Core
|
|||||||
if (myTcpServer == null)
|
if (myTcpServer == null)
|
||||||
{
|
{
|
||||||
myTcpServer = new TCPServer(Port, MaxClients);
|
myTcpServer = new TCPServer(Port, MaxClients);
|
||||||
|
if(HeartbeatRequired)
|
||||||
myTcpServer.SocketSendOrReceiveTimeOutInMs = (this.HeartbeatRequiredIntervalMs * 5);
|
myTcpServer.SocketSendOrReceiveTimeOutInMs = (this.HeartbeatRequiredIntervalMs * 5);
|
||||||
|
|
||||||
// myTcpServer.HandshakeTimeout = 30;
|
// myTcpServer.HandshakeTimeout = 30;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<NoStdLib>true</NoStdLib>
|
<NoStdLib>true</NoStdLib>
|
||||||
<NoConfig>true</NoConfig>
|
<NoConfig>true</NoConfig>
|
||||||
|
<DocumentationFile>bin\PepperDash_Core.xml</DocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="mscorlib" />
|
<Reference Include="mscorlib" />
|
||||||
|
|||||||
@@ -4,4 +4,4 @@
|
|||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("Pepperdash_Core")]
|
[assembly: AssemblyProduct("Pepperdash_Core")]
|
||||||
[assembly: AssemblyCopyright("Copyright © PepperDash 2019")]
|
[assembly: AssemblyCopyright("Copyright © PepperDash 2019")]
|
||||||
[assembly: AssemblyVersion("1.0.21.*")]
|
[assembly: AssemblyVersion("1.0.22.*")]
|
||||||
|
|||||||
Reference in New Issue
Block a user