summaryrefslogtreecommitdiffstats
path: root/src/Core
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-07-07 01:12:19 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-07-07 01:12:19 +0200
commit30f0cb9154306938250bd77ce2f0a9471065732a (patch)
treeeed6304d1c07d6ea5177520e095315a8b3c6856d /src/Core
parentab391a3989b15c51e5b21cbcdd4f7caff8c6ec2b (diff)
downloadmad-30f0cb9154306938250bd77ce2f0a9471065732a.tar
mad-30f0cb9154306938250bd77ce2f0a9471065732a.zip
Benutze *-Listener, wenn keiner konfiguriert ist
Diffstat (limited to 'src/Core')
-rw-r--r--src/Core/ConnectionManager.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp
index 48d9c17..b9903c9 100644
--- a/src/Core/ConnectionManager.cpp
+++ b/src/Core/ConnectionManager.cpp
@@ -51,14 +51,24 @@ void ConnectionManager::refreshPollfds() {
}
ConnectionManager::ConnectionManager(const std::vector<Net::IPAddress> &listenerAddresses) {
- for(std::vector<Net::IPAddress>::const_iterator address = listenerAddresses.begin(); address != listenerAddresses.end(); ++address) {
+ if(listenerAddresses.empty()) {
try {
- listeners.push_back(new Net::Listener(*address));
+ listeners.push_back(new Net::Listener());
}
catch(Net::Exception &e) {
// TODO: Log error
}
}
+ else {
+ for(std::vector<Net::IPAddress>::const_iterator address = listenerAddresses.begin(); address != listenerAddresses.end(); ++address) {
+ try {
+ listeners.push_back(new Net::Listener(*address));
+ }
+ catch(Net::Exception &e) {
+ // TODO: Log error
+ }
+ }
+ }
refreshPollfds();
}