Initialize nifm session for network check

This commit is contained in:
Michael Theall 2020-04-08 23:36:29 -05:00
parent 49b2571336
commit 7591a39cfd
2 changed files with 7 additions and 8 deletions

View File

@ -165,12 +165,6 @@ std::time_t FtpServer::startTime ()
void FtpServer::handleNetworkFound ()
{
{
auto lock = std::scoped_lock (m_lock);
if (m_socket)
return;
}
struct sockaddr_in addr;
addr.sin_family = AF_INET;
#if defined(_3DS) || defined(__SWITCH__)
@ -215,9 +209,12 @@ void FtpServer::handleNetworkLost ()
}
void FtpServer::loop ()
{
if (!m_socket)
{
if (platform::networkVisible ())
handleNetworkFound ();
}
// poll listen socket
if (m_socket)

View File

@ -56,6 +56,7 @@ void userAppInit ()
romfsInit ();
plInitialize ();
nifmInitialize (NifmServiceType_User);
if (R_FAILED (socketInitialize (&s_socketInitConfig)))
return;
@ -76,6 +77,7 @@ void userAppExit ()
}
#endif
nifmExit ();
plExit ();
romfsExit ();
appletUnlockExit ();