changeset 124:23137a333c93 scope-refactoring

Implemented destructor of UdpServer which closes the socket
author Giulio Moro <giuliomoro@yahoo.it>
date Sat, 22 Aug 2015 02:51:39 +0100
parents d6245d5880c5
children 850a4a9bd832
files core/UdpServer.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/UdpServer.cpp	Sat Aug 22 02:50:57 2015 +0100
+++ b/core/UdpServer.cpp	Sat Aug 22 02:51:39 2015 +0100
@@ -13,6 +13,8 @@
 	init(0);
 }
 UdpServer::~UdpServer(){
+	printf("Close the socket\n");
+	shutdown(inSocket, 0); //Stop receiving data for this socket. If further data arrives, reject it.
 	//TODO: unbind from port. AFAIK, this involves closing the socket, therefore creating the socket should become part of bindToPort
 };
 bool UdpServer::init(int aPort){