From f73d200a1ea56aa68ee5df3935eb83e04537c59f Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 20 Jul 2020 07:21:16 +0100 Subject: Split OnSetEndPoint into two events. --- include/inspsocket.h | 13 +++++++++---- include/users.h | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/inspsocket.h b/include/inspsocket.h index aa6194794..623720f97 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -323,12 +323,17 @@ class CoreExport StreamSocket : public EventHandler /** Called when the socket gets an error from socket engine or IO hook */ virtual void OnError(BufferedSocketError e) = 0; - /** Called when the endpoint addresses are changed. - * @param local The new local endpoint. - * @param remote The new remote endpoint. + /** Called when the local endpoint address is changed. + * @param ep The new local endpoint. * @return true if the connection is still open, false if it has been closed */ - virtual bool OnSetEndPoint(const irc::sockets::sockaddrs& local, const irc::sockets::sockaddrs& remote); + virtual bool OnSetLocalEndPoint(const irc::sockets::sockaddrs& ep) { return true; } + + /** Called when the remote endpoint address is changed. + * @param ep The new remote endpoint. + * @return true if the connection is still open, false if it has been closed + */ + virtual bool OnSetRemoteEndPoint(const irc::sockets::sockaddrs& ep) { return true; } /** Send the given data out the socket, either now or when writes unblock */ diff --git a/include/users.h b/include/users.h index eeec0295a..d336478fc 100644 --- a/include/users.h +++ b/include/users.h @@ -634,7 +634,8 @@ class CoreExport UserIOHandler : public StreamSocket { } void OnDataReady() override; - bool OnSetEndPoint(const irc::sockets::sockaddrs& local, const irc::sockets::sockaddrs& remote) override; + bool OnSetLocalEndPoint(const irc::sockets::sockaddrs& ep) override; + bool OnSetRemoteEndPoint(const irc::sockets::sockaddrs& ep) override; void OnError(BufferedSocketError error) override; /** Adds to the user's write buffer. -- cgit v1.3.1-10-gc9f91