summaryrefslogtreecommitdiff
path: root/src/network/core/udp.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-05-13 11:46:51 +0200
committerGitHub <noreply@github.com>2021-05-13 11:46:51 +0200
commita403653805c6fd6022868c5f381e10107e1d2b20 (patch)
treeb44e4df40d65cf1fecdadab090badb73d78e0a6d /src/network/core/udp.h
parent86741ad489c3ee2d519eeb071be846721b90412c (diff)
downloadopenttd-a403653805c6fd6022868c5f381e10107e1d2b20.tar.xz
Codechange: [Network] split CloseSocket and CloseConnection more clearly (#9261)
* Codechange: [Network] split CloseSocket and CloseConnection more clearly - CloseSocket now closes the actual OS socket. - CloseConnection frees up the resources to just before CloseSocket. - dtors call CloseSocket / CloseConnection where needed.
Diffstat (limited to 'src/network/core/udp.h')
-rw-r--r--src/network/core/udp.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/network/core/udp.h b/src/network/core/udp.h
index ab898eeee..489e21985 100644
--- a/src/network/core/udp.h
+++ b/src/network/core/udp.h
@@ -49,8 +49,6 @@ protected:
/** The opened sockets. */
SocketList sockets;
- NetworkRecvStatus CloseConnection(bool error = true) override;
-
void ReceiveInvalidPacket(PacketUDPType, NetworkAddress *client_addr);
/**
@@ -187,10 +185,10 @@ public:
NetworkUDPSocketHandler(NetworkAddressList *bind = nullptr);
/** On destructing of this class, the socket needs to be closed */
- virtual ~NetworkUDPSocketHandler() { this->Close(); }
+ virtual ~NetworkUDPSocketHandler() { this->CloseSocket(); }
bool Listen();
- void Close();
+ void CloseSocket();
void SendPacket(Packet *p, NetworkAddress *recv, bool all = false, bool broadcast = false);
void ReceivePackets();