MCPcopy Create free account
hub / github.com/defold/defold / sendraw

Function sendraw

engine/script/src/luasocket/buffer.c:167–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165\*-------------------------------------------------------------------------*/
166#define STEPSIZE 8192
167static int sendraw(p_buffer buf, const char *data, size_t count, size_t *sent) {
168 p_io io = buf->io;
169 p_timeout tm = buf->tm;
170 size_t total = 0;
171 int err = IO_DONE;
172 while (total < count && err == IO_DONE) {
173 size_t done = 0;
174 size_t step = (count-total <= STEPSIZE)? count-total: STEPSIZE;
175 err = io->send(io->ctx, data+total, step, &done, tm);
176 total += done;
177 }
178 *sent = total;
179 buf->sent += total;
180 return err;
181}
182
183/*-------------------------------------------------------------------------*\
184* Reads a fixed number of bytes (buffered)

Callers 1

buffer_meth_sendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected