11 #include <Atlas/Net/Stream.h>
12 #include <Atlas/Codec.h>
14 #include "DebugBridge.h"
17 #include <skstream/skstream.h>
31 std::cout <<
"Sending hello world message... " << std::flush;
33 c.mapStringItem(
"hello",
"world");
35 std::cout <<
"done." << std::endl;
38 int main(
int argc,
char** argv)
41 tcp_socket_stream connection;
43 std::cout <<
"Connecting..." << std::flush;
47 connection.open(argv[1], 6767);
49 connection.open(
"127.0.0.1", 6767);
57 std::cout <<
"Negotiating... " << std::flush;
59 while (conn.getState() == Atlas::Net::StreamConnect::IN_PROGRESS) {
62 std::cout <<
"done" << std::endl;
65 if (conn.getState() == Atlas::Net::StreamConnect::FAILED) {
66 std::cerr <<
"Failed to negotiate" << std::endl;
79 connection << std::flush;
81 std::cout <<
"Sleeping for 2 seconds... " << std::flush;
84 std::cout <<
"done." << std::endl;
88 std::cout <<
"Server exited." << std::endl;
91 std::cout <<
"Closing connection... " << std::flush;
94 connection << std::flush;
97 std::cout <<
"done." << std::endl;