| 199 | } |
| 200 | |
| 201 | void do_test6() |
| 202 | { |
| 203 | dlib::pipe<int> in(0), out(300); |
| 204 | |
| 205 | bridge b1(connect_to_ip_and_port("127.0.0.1",testing_port), receive(in)); |
| 206 | bridge b2(listen_on_port(testing_port), transmit(out)); |
| 207 | |
| 208 | for (int i = 0; i < 100; ++i) |
| 209 | { |
| 210 | int val = i; |
| 211 | out.enqueue(val); |
| 212 | } |
| 213 | |
| 214 | int val = 10; |
| 215 | in.dequeue(val); |
| 216 | DLIB_TEST(val == 0); |
| 217 | dlib::sleep(100); |
| 218 | in.dequeue(val); |
| 219 | DLIB_TEST(val == 1); |
| 220 | dlib::sleep(100); |
| 221 | } |
| 222 | |
| 223 | class test_bridge : public tester |
| 224 | { |
no test coverage detected