Skip to content

Commit

Permalink
bool Connected() Updated
Browse files Browse the repository at this point in the history
Added a ping to Connected() so that it may return the current value regardless of if other data is being sent.
  • Loading branch information
xNWP committed Oct 17, 2017
1 parent 48df0ed commit 1cd22bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion HLAEServer/AssemblyInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using namespace System::Security::Permissions;
[assembly:AssemblyCultureAttribute(L"")];


[assembly:AssemblyVersionAttribute("1.0.0.1")];
[assembly:AssemblyVersionAttribute("1.0.0.2")];

[assembly:ComVisible(false)];

Expand Down
11 changes: 11 additions & 0 deletions HLAEServer/HLAE_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,20 @@ namespace HLAEServer

inline bool HLAE_WS_Client::Connected()
{
SendPing(); // We'll ping the server to update Connected.
return m_socket->Connected;
}

void HLAE_WS_Client::SendPing()
{
int Code = 0b10001001;
array<Byte>^ Payload = gcnew array<Byte>(2);
Payload[0] = (Byte)Code;
Payload[1] = 0; // Mask = 0, Payload Length = 0.

SendData(Payload);
}

void HLAE_WS_Client::ReadDataWS()
{

Expand Down
1 change: 1 addition & 0 deletions HLAEServer/HLAE_Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ namespace HLAEServer
int StartAfter(array<Byte>^ data, String^ key);
void DoHandShake(array<Byte>^ data);
void SendData(array<Byte>^ data);
void SendPing();
float FourByteFloatLE(array<Byte>^ data, int offset);
UInt32 FourByteUInt32LE(array<Byte>^ data, int offset);
UInt16 TwoByteUInt16BE(array<Byte>^ data, int offset);
Expand Down

0 comments on commit 1cd22bb

Please sign in to comment.