summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-23 14:19:33 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-23 14:19:33 +0000
commit529c6acc0177651e0b01cc6d7dcb7509fce17d14 (patch)
treeaf36cb6a39faf8442a7cb7bab162c13f0531c53e /src/socket.cpp
parent371daf9928def23164b49b39ced1d3cdeb9225b8 (diff)
Unload as many modules as we can on restart, and close listeners
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6068 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 70356be6c..ee21400d3 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -47,6 +47,16 @@ ListenSocket::ListenSocket(InspIRCd* Instance, int sockfd, insp_sockaddr client,
}
}
+ListenSocket::~ListenSocket()
+{
+ if (this->GetFd() > -1)
+ {
+ shutdown(this->fd, 2);
+ close(this->fd);
+ this->fd = -1;
+ }
+}
+
void ListenSocket::HandleEvent(EventType et, int errornum)
{
insp_sockaddr sock_us; // our port number