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

Function main

lib_acl/samples/server1/main.cpp:23–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23int main(int argc, char *argv[])
24{
25 ACL_VSTREAM *sstream, *client;
26 const char *addr = "127.0.0.1:30082";
27
28 acl_init();
29
30 sstream = acl_vstream_listen(addr, 128);
31 if (sstream == NULL) {
32 printf("listen on %s error(%s)\r\n", addr, acl_last_serror());
33 getchar();
34 return (0);
35 }
36
37 printf("listening on %s ...\r\n", addr);
38
39 while (1) {
40 client = acl_vstream_accept(sstream, NULL, 0);
41 if (client == NULL) {
42 printf("accept error(%s)\r\n", acl_last_serror());
43 break;
44 }
45 echo(client);
46 acl_vstream_close(client);
47 }
48
49 printf("Over now\r\n");
50 getchar();
51 return (0);
52}

Callers

nothing calls this directly

Calls 5

acl_vstream_listenFunction · 0.85
acl_last_serrorFunction · 0.85
acl_vstream_acceptFunction · 0.85
acl_vstream_closeFunction · 0.85
echoFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…