Use local socket (named pipe) connection also on Windows

This commit is contained in:
Daniel Molkentin 2014-10-10 15:54:32 +02:00
parent c4f96c2fba
commit 3ebe3b1196
2 changed files with 0 additions and 28 deletions

View File

@ -60,10 +60,6 @@ CSYNC_EXCLUDE_TYPE csync_excluded_no_ctx(c_strlist_t *excludes, const char *path
int csync_exclude_load(const char *fname, c_strlist_t **list);
}
namespace {
const int PORT = 34001;
}
namespace Mirall {
#define DEBUG qDebug() << "SocketApi: "
@ -225,17 +221,6 @@ SocketApi::SocketApi(QObject* parent)
: QObject(parent)
, _excludes(0)
{
qDebug() << "Hello";
qWarning() << "gello";
#ifdef SOCKETAPI_TCP
// setup socket
DEBUG << "Establishing SocketAPI server at" << PORT;
if (!_localServer.listen(QHostAddress::LocalHost, PORT)) {
DEBUG << "Failed to bind to port" << PORT;
}
#else
QString socketPath;
if (Utility::isWindows()) {
@ -277,7 +262,6 @@ SocketApi::SocketApi(QObject* parent)
DEBUG << "server started, listening at " << socketPath;
}
#endif
connect(&_localServer, SIGNAL(newConnection()), this, SLOT(slotNewConnection()));
// folder watcher

View File

@ -33,19 +33,7 @@ class QStringList;
namespace Mirall {
//Define this to use the old school TCP API. Maybe we should offer both APIs
// and have the old TCP one be enableable via command line switch?
//#define SOCKETAPI_TCP
#if defined(Q_OS_WIN)
// Windows plugin has not been ported
#define SOCKETAPI_TCP
#endif
#ifdef SOCKETAPI_TCP
typedef QTcpSocket SocketType;
#else
typedef QLocalSocket SocketType;
#endif
class SocketApi : public QObject
{