- I think closing sockets is a good idea

Tue, 16 Dec 2014 01:46:22 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Tue, 16 Dec 2014 01:46:22 +0200
changeset 56
b4caacf567af
parent 55
79e5460a8a56
child 57
a2f41245e387

- I think closing sockets is a good idea

sources/network/udpsocket.cpp file | annotate | diff | comparison | revisions
--- a/sources/network/udpsocket.cpp	Tue Dec 16 00:55:03 2014 +0200
+++ b/sources/network/udpsocket.cpp	Tue Dec 16 01:46:22 2014 +0200
@@ -34,6 +34,7 @@
 #include <netinet/in.h>
 #include <string.h>
 #include <fcntl.h>
+#include <unistd.h>
 #include "udpsocket.h"
 #include "../huffman/huffman.h"
 
@@ -46,7 +47,10 @@
 
 // -----------------------------------------------------------------------------
 //
-UDPSocket::~UDPSocket() {}
+UDPSocket::~UDPSocket()
+{
+	close (m_socket);
+}
 
 // -------------------------------------------------------------------------------------------------
 //

mercurial