From 91bdac7f768e538a2e25b04347b747b1902e3159 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 26 Jun 2008 02:48:06 +0200 Subject: Verhindere das Kopieren von Connection- und Listener-Objekten --- src/Net/Connection.h | 6 +++++- src/Net/Listener.h | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Net/Connection.h b/src/Net/Connection.h index a5bda5a..0ef3ebf 100644 --- a/src/Net/Connection.h +++ b/src/Net/Connection.h @@ -63,6 +63,10 @@ class Connection { return (transR.length == transR.transmitted); } + // Prevent shallow copy + Connection(const Connection &o); + Connection& operator=(const Connection &o); + protected: struct ConnectionHeader { unsigned char m; @@ -114,7 +118,7 @@ class Connection { bool isConnected() const {return (state != DISCONNECTED);} bool isConnecting() { - return (state == HANDSHAKE || state == CONNECTION_HEADER); + return (state == HANDSHAKE || state == CONNECTION_HEADER); } const IPAddress* getPeer() {return peer;} diff --git a/src/Net/Listener.h b/src/Net/Listener.h index 0837fb0..5c59a6e 100644 --- a/src/Net/Listener.h +++ b/src/Net/Listener.h @@ -39,6 +39,10 @@ class Listener { std::list connections; + // Prevent shallow copy + Listener(const Listener &o); + Listener& operator=(const Listener &o); + public: Listener(const IPAddress &address0) throw(ConnectionException); virtual ~Listener(); -- cgit v1.2.3