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

Method on_connect

examples/sockets_ex.cpp:26–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24class serv : public server
25{
26 void on_connect (
27 connection& con
28 )
29 {
30 char ch;
31 while (con.read(&ch,1) > 0)
32 {
33 // we are just reading one char at a time and writing it back
34 // to the connection. If there is some problem writing the char
35 // then we quit the loop.
36 if (con.write(&ch,1) != 1)
37 break;
38 }
39 }
40
41};
42

Callers

nothing calls this directly

Calls 2

readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected