diff options
Diffstat (limited to 'server/src/tcpsocket.cc')
-rw-r--r-- | server/src/tcpsocket.cc | 5 |
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()); |