| 37 | bool test_failed; |
| 38 | |
| 39 | void write_thread ( |
| 40 | ) |
| 41 | { |
| 42 | try |
| 43 | { |
| 44 | std::unique_ptr<connection> con(connect("127.0.0.1", port_num)); |
| 45 | |
| 46 | // Send a copy of the data down the connection so we can test our the read() function |
| 47 | // that uses timeouts in the main thread. |
| 48 | if (con->write(data_to_send.data(), data_to_send.size()) != (int)data_to_send.size()) |
| 49 | { |
| 50 | test_failed = true; |
| 51 | dlog << LERROR << "failed to send all the data down the connection"; |
| 52 | } |
| 53 | |
| 54 | close_gracefully(con,300000); |
| 55 | } |
| 56 | catch (exception& e) |
| 57 | { |
| 58 | test_failed = true; |
| 59 | dlog << LERROR << e.what(); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | void no_write_thread ( |
| 64 | ) |