diff --git a/sciotest/main.cpp b/sciotest/main.cpp index 97c93a6..75f811a 100644 --- a/sciotest/main.cpp +++ b/sciotest/main.cpp @@ -49,11 +49,18 @@ void test2() { for (;;) { sc::io::socketstream client = server.accept(); cerr << "connection from " << client.address() << '\n'; - client << "ready to echo...\n"; + client << "ready to echo...\necho> "; string line; while (getline(client, line)) { - cerr << "received: " << line << '\n'; - client << line << '\n'; + cerr << "received: " << line << "\n"; + if (line == "quit\r") { + client << "bye\n"; + client.close(); + break; + } else { + client << line << '\n'; + } + client << "echo> "; } } }