Skip to content

Commit

Permalink
Change function to stop listening name
Browse files Browse the repository at this point in the history
  • Loading branch information
rechrtb committed Dec 8, 2022
1 parent 30ca800 commit 60aa8cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ bool Connection::Listen(uint16_t port, uint32_t ip, uint8_t protocol, uint16_t m
return Listener::Start(port, ip, protocol, maxConns, tempPcb);
}

void Connection::Dismiss(uint16_t port)
void Connection::StopListen(uint16_t port)
{
for (Listener *p = Listener::List(); p != nullptr; )
{
Expand Down
2 changes: 1 addition & 1 deletion src/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Connection
static Connection *Allocate();
static void Init();
static bool Listen(uint16_t port, uint32_t ip, uint8_t protocol, uint16_t maxConns);
static void Dismiss(uint16_t port);
static void StopListen(uint16_t port);
static void PollAll();
static void TerminateAll();

Expand Down
4 changes: 2 additions & 2 deletions src/SocketServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ void ProcessRequest()
messageHeaderIn.hdr.param32 = hspi.transfer32(ResponseEmpty);
ListenOrConnectData lcData;
hspi.transferDwords(nullptr, reinterpret_cast<uint32_t*>(&lcData), NumDwords(sizeof(lcData)));
Connection::Dismiss(lcData.port);
Connection::StopListen(lcData.port);
RebuildServices(); // update the MDNS services
debugPrintf("Stopped listening on port %u\n", lcData.port);
}
Expand Down Expand Up @@ -1512,7 +1512,7 @@ void ProcessRequest()

case NetworkCommand::networkStop: // disconnect from an access point, or close down our own access point
Connection::TerminateAll(); // terminate all connections
Connection::Dismiss(0); // stop listening on all ports
Connection::StopListen(0); // stop listening on all ports
RebuildServices(); // remove the MDNS services
switch (currentState)
{
Expand Down

0 comments on commit 60aa8cb

Please sign in to comment.