| 168 | } |
| 169 | |
| 170 | int sendData(int socket, uint8_t *buf, int buflen) { |
| 171 | int ret = 0, bytes = 0; |
| 172 | |
| 173 | while (bytes < buflen) { |
| 174 | ret = send(socket, buf + bytes, buflen - bytes, 0); |
| 175 | //check for errors |
| 176 | if (ret == -1) { |
| 177 | return ret; |
| 178 | } |
| 179 | bytes += ret; |
| 180 | } |
| 181 | |
| 182 | return bytes; |
| 183 | } |
| 184 | |
| 185 | void error(const char *msg) { |
| 186 | perror(msg); |
no outgoing calls
no test coverage detected