Skip to content
Snippets Groups Projects
Commit 1df60139 authored by Robert Schmidt's avatar Robert Schmidt
Browse files

Automatically close GTP sockets at program end

parent 19d83ad2
No related branches found
No related tags found
No related merge requests found
......@@ -142,6 +142,12 @@ class gtpEndPoints {
pthread_mutex_t gtp_lock=PTHREAD_MUTEX_INITIALIZER;
// the instance id will be the Linux socket handler, as this is uniq
map<int, gtpEndPoint> instances;
~gtpEndPoints() {
// automatically close all sockets on quit
for (const auto p : instances)
close(p.first);
}
};
gtpEndPoints globGtp;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment