| 19 | } |
| 20 | |
| 21 | bool running(void) |
| 22 | { |
| 23 | acl::socket_stream* conn = new acl::socket_stream; |
| 24 | if (conn->open(addr_, 10, 10) == false) |
| 25 | { |
| 26 | printf("open %s error %s\r\n", addr_.c_str(), |
| 27 | acl::last_serror()); |
| 28 | return false; |
| 29 | } |
| 30 | |
| 31 | if (conn->puts("hello world1") == -1) |
| 32 | { |
| 33 | printf("write error\r\n"); |
| 34 | delete conn; |
| 35 | return false; |
| 36 | } |
| 37 | |
| 38 | acl::string buf; |
| 39 | if (conn->gets(buf, false) == false) |
| 40 | { |
| 41 | printf("gets error\r\n"); |
| 42 | delete conn; |
| 43 | return false; |
| 44 | } |
| 45 | |
| 46 | delete conn; |
| 47 | return true; |
| 48 | } |
| 49 | |
| 50 | private: |
| 51 | int max_; |
nothing calls this directly
no test coverage detected