diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-11-20 00:33:28 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-11-20 00:33:28 +0100 |
commit | 0a1df98c0420e9ac097622f2bddcd73a6488ed52 (patch) | |
tree | 65f5eaa940bcf5d8c38b88b4fd369cfee43a4a7f /src/Net | |
parent | 854421e2c144ab6454d67beb6640579ad13f1a1f (diff) | |
download | mad-0a1df98c0420e9ac097622f2bddcd73a6488ed52.tar mad-0a1df98c0420e9ac097622f2bddcd73a6488ed52.zip |
SingletonPtr hinzugefuegt
Diffstat (limited to 'src/Net')
-rw-r--r-- | src/Net/ClientConnection.cpp | 2 | ||||
-rw-r--r-- | src/Net/Connection.cpp | 4 | ||||
-rw-r--r-- | src/Net/FdManager.h | 2 | ||||
-rw-r--r-- | src/Net/Listener.cpp | 2 | ||||
-rw-r--r-- | src/Net/ServerConnection.cpp | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/src/Net/ClientConnection.cpp b/src/Net/ClientConnection.cpp index 25673fd..75a9ad6 100644 --- a/src/Net/ClientConnection.cpp +++ b/src/Net/ClientConnection.cpp @@ -98,7 +98,7 @@ void ClientConnection::connect(const IPAddress &address, bool daemon0) throw(Com gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, x509_cred); gnutls_transport_set_ptr(session, (gnutls_transport_ptr_t)sock); - FdManager::getFdManager()->registerFd(sock, sigc::mem_fun(this, &Connection::sendReceive)); + FdManager::get()->registerFd(sock, sigc::mem_fun(this, &Connection::sendReceive)); handshake(); } diff --git a/src/Net/Connection.cpp b/src/Net/Connection.cpp index 5454dcf..7f8d9a9 100644 --- a/src/Net/Connection.cpp +++ b/src/Net/Connection.cpp @@ -288,7 +288,7 @@ void Connection::doDisconnect() { if(!isConnected()) return; - FdManager::getFdManager()->unregisterFd(sock); + FdManager::get()->unregisterFd(sock); shutdown(sock, SHUT_RDWR); close(sock); @@ -304,7 +304,7 @@ void Connection::updateEvents() const { if(state == HANDSHAKE || state == BYE) events = ((gnutls_record_get_direction(session) == 0) ? POLLIN : POLLOUT); - FdManager::getFdManager()->setFdEvents(sock, events); + FdManager::get()->setFdEvents(sock, events); } } diff --git a/src/Net/FdManager.h b/src/Net/FdManager.h index 1308a79..2e6fc66 100644 --- a/src/Net/FdManager.h +++ b/src/Net/FdManager.h @@ -44,7 +44,7 @@ class FdManager { public: virtual ~FdManager(); - static FdManager *getFdManager() {return &fdManager;} + static FdManager *get() {return &fdManager;} bool registerFd(int fd, const sigc::slot<void, short> &handler, short events = 0); bool unregisterFd(int fd); diff --git a/src/Net/Listener.cpp b/src/Net/Listener.cpp index ed820d0..c4c5194 100644 --- a/src/Net/Listener.cpp +++ b/src/Net/Listener.cpp @@ -78,7 +78,7 @@ Listener::Listener(const std::string &x905CertFile0, const std::string &x905KeyF throw Common::Exception("listen()", Common::Exception::INTERNAL_ERRNO, errno); } - FdManager::getFdManager()->registerFd(sock, sigc::mem_fun(this, &Listener::acceptHandler), POLLIN); + FdManager::get()->registerFd(sock, sigc::mem_fun(this, &Listener::acceptHandler), POLLIN); } Listener::~Listener() { diff --git a/src/Net/ServerConnection.cpp b/src/Net/ServerConnection.cpp index 05cc861..97e2ae4 100644 --- a/src/Net/ServerConnection.cpp +++ b/src/Net/ServerConnection.cpp @@ -73,7 +73,7 @@ ServerConnection::ServerConnection(int sock0, const IPAddress &address, gnutls_d gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, x509_cred); gnutls_transport_set_ptr(session, (gnutls_transport_ptr_t)sock); - FdManager::getFdManager()->registerFd(sock, sigc::mem_fun(this, &Connection::sendReceive)); + FdManager::get()->registerFd(sock, sigc::mem_fun(this, &Connection::sendReceive)); handshake(); } |