X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcorenetwork.h;h=8093bb61c10f3e302745ccbbc36f5ca3500d4aa5;hp=c1f96f2091e6d6af2358ede3f0c7c4a14b249731;hb=9c15e81b15a20e861c707e240c2cfee56bdf4bc9;hpb=88b350153eb364853e75d237d3eed2dfaf839d59 diff --git a/src/core/corenetwork.h b/src/core/corenetwork.h index c1f96f20..8093bb61 100644 --- a/src/core/corenetwork.h +++ b/src/core/corenetwork.h @@ -33,6 +33,7 @@ #else # include #endif +#include #ifdef HAVE_QCA2 # include "cipher.h" @@ -85,6 +86,13 @@ public: inline UserId userId() const { return _coreSession->user(); } + inline QAbstractSocket::SocketState socketState() const { return socket.state(); } + inline bool socketConnected() const { return socket.state() == QAbstractSocket::ConnectedState; } + inline QHostAddress localAddress() const { return socket.localAddress(); } + inline QHostAddress peerAddress() const { return socket.peerAddress(); } + inline quint16 localPort() const { return socket.localPort(); } + inline quint16 peerPort() const { return socket.peerPort(); } + public slots: virtual void setMyNick(const QString &mynick); @@ -146,6 +154,8 @@ signals: void sslErrors(const QVariant &errorData); void newEvent(Event *event); + void socketInitialized(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort); + void socketDisconnected(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort); protected: inline virtual IrcChannel *ircChannelFactory(const QString &channelname) { return new CoreIrcChannel(channelname, this); }