| 132 | // ---------------------------------------------------------------------------------------- |
| 133 | |
| 134 | void test2() |
| 135 | { |
| 136 | dlog << LINFO << "in test2()"; |
| 137 | serv2 theserv; |
| 138 | theserv.set_listening_port(12345); |
| 139 | theserv.start_async(); |
| 140 | |
| 141 | // wait a little bit to make sure the server has started listening before we try |
| 142 | // to connect to it. |
| 143 | dlib::sleep(500); |
| 144 | |
| 145 | for (int i = 0; i < 200; ++i) |
| 146 | { |
| 147 | dlog << LINFO << "i: " << i; |
| 148 | print_spinner(); |
| 149 | iosockstream stream("localhost:12345"); |
| 150 | |
| 151 | std::string temp; |
| 152 | stream >> temp; DLIB_TEST(temp == "one"); |
| 153 | stream >> temp; DLIB_TEST(temp == "two"); |
| 154 | stream >> temp; DLIB_TEST(temp == "three"); |
| 155 | stream >> temp; DLIB_TEST(temp == "four"); |
| 156 | stream >> temp; DLIB_TEST(temp == "five"); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | // ---------------------------------------------------------------------------------------- |
| 161 |
no test coverage detected