Skip to content

Commit 1cef414

Browse files
committed
Updated the code so everything runs out of the box...
1 parent bce73e2 commit 1cef414

File tree

6 files changed

+1086
-6
lines changed

6 files changed

+1086
-6
lines changed

.vs/config/applicationhost.config

+1,067
Large diffs are not rendered by default.

RemoteDesktopServer_Library/Server.cpp

+15-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ RemoteDesktop::Server::~Server(){
6161
_SystemTray = nullptr;
6262

6363
}
64+
6465
void RemoteDesktop::Server::_CreateSystemMenu(){
6566
_SystemTray->AddMenuItem(L"Exit", DELEGATE(&RemoteDesktop::Server::_TriggerShutDown));
6667
_SystemTray->AddMenuItem(L"Exit and Remove", DELEGATE(&RemoteDesktop::Server::_TriggerShutDown_and_RemoveSelf));
@@ -496,6 +497,19 @@ void RemoteDesktop::Server::_Run() {
496497
if (lastwaittime < 0) lastwaittime = 0;
497498
//DEBUG_MSG("Time for work... %", t1.Elapsed_milli());
498499
}
500+
AllStop();
499501
DEBUG_MSG("Stopping Main Server Loop");
500-
_NetworkServer = nullptr;
502+
}
503+
504+
void RemoteDesktop::Server::AllStop()
505+
{
506+
_PendingNewClients.clear();
507+
_NewClients.clear();
508+
_DesktopMonitor = nullptr;
509+
_NetworkServer.reset();
510+
511+
_ClipboardMonitor = nullptr;
512+
_SystemTray = nullptr;
513+
514+
501515
}

RemoteDesktopServer_Library/Server.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace RemoteDesktop{
7474
bool _RemoveOnExit = false;
7575
bool GetProxyID(std::wstring url, std::wstring& aeskey);
7676
void _Run();
77-
77+
void AllStop();
7878

7979
public:
8080
Server();

RemoteDesktop_GatewayExample/Web.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<add key="RAT_P2P_File" value="~/Content/RAT/RemoteDesktop_ServerP2P.exe" />
2222
<add key="RAT_ServiceName" value="RAT_svc" />
2323
<add key="RAT_Serive_Display_Name" value="RAT Service Name" />
24-
<add key="RAT_Gateway_Listen_Port" value="5939" />
24+
<add key="RAT_Gateway_Listen_Port" value="443" />
2525
<add key="RAT_Gateway_External_Connect_Port" value="443" />
2626
<add key="RAT_GatewayHostName" value="localhost" />
2727
<add key="RAT_Disclaimer" value="Do you agree to allow a support technician to connection to your computer?" />

RemoteDesktop_Library/NetworkSetup.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ SOCKET RemoteDesktop::Connect(std::wstring port, std::wstring host){
130130

131131
closesocket(ConnectSocket);
132132
ConnectSocket = INVALID_SOCKET;
133-
DEBUG_MSG("Server Down....");
134133
}
135134

136135
FreeAddrInfoW(result);

RemoteDesktop_Library/Utilities.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ void DEBUG_MSG(const char *s, Args... args)
2828
#if _DEBUG
2929
std::string result = "";
3030
_INTERNAL::xsprintf(result, s, args...);
31-
//OutputDebugStringA(result.c_str());
32-
//OutputDebugStringA("\n");
31+
OutputDebugStringA(result.c_str());
32+
OutputDebugStringA("\n");
3333
std::cout << result << std::endl;
3434
#endif
3535
}

0 commit comments

Comments
 (0)