summaryrefslogtreecommitdiff
path: root/server/src/tcpsocket.cc
diff options
context:
space:
mode:
authordeva <deva>2009-08-07 13:21:27 +0000
committerdeva <deva>2009-08-07 13:21:27 +0000
commitf23b20281a5d0badd8c2d2904b44365418ad46a5 (patch)
treea7ff5e9961126e7893d888c5022977c028cf64cc /server/src/tcpsocket.cc
parent1e1217e49bcac9228e37c7b6868d63da900ab07f (diff)
New test program.
Diffstat (limited to 'server/src/tcpsocket.cc')
-rw-r--r--server/src/tcpsocket.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/src/tcpsocket.cc b/server/src/tcpsocket.cc
index f72d7b6..f748e0a 100644
--- a/server/src/tcpsocket.cc
+++ b/server/src/tcpsocket.cc
@@ -392,9 +392,10 @@ int main()
try {
TCPSocket listen_sock;
listen_sock.listen(12345);
- TCPSocket sock = listen_sock.accept();
- sock.read(buf, sizeof(buf));
+ TCPSocket *sock = listen_sock.accept();
+ sock->read(buf, sizeof(buf));
printf("Got: [%s]\n", buf);
+ delete sock;
if(std::string(buf) != "hello") return 1;
} catch( Exception &e ) {
fprintf(stderr, "%s\n", e.what());