| 12 | |
| 13 | protected: |
| 14 | void* run(void) |
| 15 | { |
| 16 | char* buf = (char*) malloc(dlen_); |
| 17 | memset(buf, 'X', dlen_); |
| 18 | int flags = MSG_NOSIGNAL; |
| 19 | if (zerocp_) { |
| 20 | flags |= MSG_ZEROCOPY; |
| 21 | conn_->set_zerocopy(true); |
| 22 | } |
| 23 | |
| 24 | for (int i = 0; i < max_; i++) |
| 25 | { |
| 26 | if (conn_->send(buf, dlen_, flags) == -1) |
| 27 | { |
| 28 | printf("send error %s\r\n", acl::last_serror()); |
| 29 | break; |
| 30 | } |
| 31 | if (zerocp_ && !conn_->wait_iocp(5000)) { |
| 32 | printf("wait result error %s\r\n", acl::last_serror()); |
| 33 | break; |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | printf("Send over!\r\n"); |
| 38 | free(buf); |
| 39 | delete conn_; |
| 40 | delete this; |
| 41 | |
| 42 | return NULL; |
| 43 | } |
| 44 | |
| 45 | private: |
| 46 | acl::socket_stream* conn_; |
nothing calls this directly
no test coverage detected