| 21 | } |
| 22 | |
| 23 | int 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…