projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f7ecaba
)
core should fallback to v4 if v6 isn't available
author
Marcus Eggenberger
<egs@quassel-irc.org>
Tue, 8 Jul 2008 13:06:00 +0000
(15:06 +0200)
committer
Marcus Eggenberger
<egs@quassel-irc.org>
Tue, 8 Jul 2008 13:06:09 +0000
(15:06 +0200)
src/core/core.cpp
patch
|
blob
|
history
diff --git
a/src/core/core.cpp
b/src/core/core.cpp
index
25bdc81
..
13a7fd9
100644
(file)
--- a/
src/core/core.cpp
+++ b/
src/core/core.cpp
@@
-340,12
+340,23
@@
QHash<BufferId, MsgId> Core::bufferLastSeenMsgIds(UserId user) {
/*** Network Management ***/
bool Core::startListening(uint port) {
/*** Network Management ***/
bool Core::startListening(uint port) {
- if(!server.listen(QHostAddress::AnyIPv6, port)) {
+ bool success = false;
+
+ // let's see if ipv6 is available
+ success = server.listen(QHostAddress::AnyIPv6, port);
+
+ if(!success && server.serverError() == QAbstractSocket::UnsupportedSocketOperationError) {
+ // fall back to v4
+ success = server.listen(QHostAddress::Any, port);
+ }
+
+ if(!success) {
qWarning("%s", qPrintable(QString("Could not open GUI client port %1: %2").arg(port).arg(server.errorString())));
qWarning("%s", qPrintable(QString("Could not open GUI client port %1: %2").arg(port).arg(server.errorString())));
- return false;
+ } else {
+ qDebug() << "Listening for GUI clients on port" << server.serverPort();
}
}
- qDebug() << "Listening for GUI clients on port" << server.serverPort();
- return
true
;
+
+ return
success
;
}
void Core::stopListening() {
}
void Core::stopListening() {