summaryrefslogtreecommitdiffstats
path: root/src/Net
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-06-26 02:48:06 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-06-26 02:48:06 +0200
commit91bdac7f768e538a2e25b04347b747b1902e3159 (patch)
treeed23ad1c1ce1ab901e512ff2b69dfe67242e049b /src/Net
parentfb949bfd7687696c47449aaea0e6a117d382d41c (diff)
downloadmad-91bdac7f768e538a2e25b04347b747b1902e3159.tar
mad-91bdac7f768e538a2e25b04347b747b1902e3159.zip
Verhindere das Kopieren von Connection- und Listener-Objekten
Diffstat (limited to 'src/Net')
-rw-r--r--src/Net/Connection.h6
-rw-r--r--src/Net/Listener.h4
2 files changed, 9 insertions, 1 deletions
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<ServerConnection*> connections;
+ // Prevent shallow copy
+ Listener(const Listener &o);
+ Listener& operator=(const Listener &o);
+
public:
Listener(const IPAddress &address0) throw(ConnectionException);
virtual ~Listener();