| 101 | } |
| 102 | |
| 103 | int64_t sendReq(int funcid, uint8_t *data, int dataLen, int tid, int64_t timestamp) { |
| 104 | if (!isRunning()) { |
| 105 | return -1; |
| 106 | } |
| 107 | uint8_t *pack = NULL; |
| 108 | uint32_t packLen = 0; |
| 109 | int64_t id = genReqPack(funcid, data, dataLen, &pack, &packLen, tid, timestamp); |
| 110 | if (id <= 0) { |
| 111 | delete[] pack; |
| 112 | return id; |
| 113 | } |
| 114 | send(m_addr, pack, packLen); |
| 115 | delete[] pack; |
| 116 | return id; |
| 117 | } |
| 118 | |
| 119 | int start(const char *ip, const int port, const int timeout, IHardCoderDataCallback *callback) { |
| 120 | m_addr = toSockaddr(ip, port); |
no test coverage detected