MCPcopy Create free account
hub / github.com/davisking/dlib / write_thread

Method write_thread

dlib/test/sockets2.cpp:39–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 )

Callers

nothing calls this directly

Calls 6

connectFunction · 0.85
close_gracefullyFunction · 0.85
writeMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected