Skip to content

Commit

Permalink
Update Windows netremote-server exe.
Browse files Browse the repository at this point in the history
  • Loading branch information
abeltrano committed Jan 19, 2024
1 parent 9340f58 commit 04206af
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/common/wifi/core/AccessPoint.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ AccessPoint::GetInterfaceName() const noexcept
std::unique_ptr<IAccessPointController>
AccessPoint::CreateController()
{
return m_accessPointControllerFactory->Create(m_interfaceName);
return (m_accessPointControllerFactory != nullptr)
? m_accessPointControllerFactory->Create(m_interfaceName)
: nullptr;
}

AccessPointFactory::AccessPointFactory(std::shared_ptr<IAccessPointControllerFactory> accessPointControllerFactory) :
Expand Down
1 change: 1 addition & 0 deletions src/windows/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ target_sources(${PROJECT_NAME}-server-windows
target_link_libraries(${PROJECT_NAME}-server-windows
PRIVATE
${PROJECT_NAME}-server
wifi-apmanager
)

set_target_properties(${PROJECT_NAME}-server-windows
Expand Down
13 changes: 11 additions & 2 deletions src/windows/server/Main.cxx
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@

#include <format>
#include <iostream>
#include <memory>

#include <microsoft/net/remote/NetRemoteServer.hxx>
#include <microsoft/net/remote/NetRemoteServerConfiguration.hxx>
#include <microsoft/net/wifi/AccessPoint.hxx>
#include <microsoft/net/wifi/AccessPointManager.hxx>

using namespace Microsoft::Net::Remote;
using namespace Microsoft::Net::Wifi;

int
main(int argc, char* argv[])
{
const auto configuration = NetRemoteServerConfiguration::FromCommandLineArguments(argc, argv);
auto configuration = NetRemoteServerConfiguration::FromCommandLineArguments(argc, argv);
{
auto accessPointFactory = std::make_unique<AccessPointFactory>(nullptr);
auto accessPointManager = AccessPointManager::Create(std::move(accessPointFactory));
configuration.AccessPointManager = accessPointManager;
}

NetRemoteServer server{ configuration.ServerAddress };
NetRemoteServer server{ std::move(configuration) };
server.Run();
server.GetGrpcServer()->Wait();

Expand Down

0 comments on commit 04206af

Please sign in to comment.