Commit 1df60139 authored by Robert Schmidt's avatar Robert Schmidt

Automatically close GTP sockets at program end

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