MCPcopy Create free account
hub / github.com/acl-dev/acl / run

Method run

lib_fiber/samples-gui/WinFiber/FiberHttpd.cpp:9–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7CFiberHttpd::~CFiberHttpd(void) {}
8
9void CFiberHttpd::run(void) {
10 acl::server_socket ss;
11 if (!ss.open(addr_)) {
12 printf("listen %s error %s\r\n", addr_.c_str(), acl::last_serror());
13 return;
14 }
15
16 printf("listen %s ok, http server started!\r\n", addr_.c_str());
17
18 while (true) {
19 acl::socket_stream* conn = ss.accept();
20 if (conn == NULL) {
21 printf("accept NULL error %s\r\n", acl::last_serror());
22 break;
23 }
24
25 printf("Accept client from %s, start http client\r\n", conn->get_peer(true));
26 acl::fiber* fb = new CFiberHttpc(conn);
27 fb->start();
28 }
29
30 delete this;
31}

Callers

nothing calls this directly

Calls 6

last_serrorFunction · 0.50
openMethod · 0.45
c_strMethod · 0.45
acceptMethod · 0.45
get_peerMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected