MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / doFlushWrite

Function doFlushWrite

modules/network/socket/win/modSocket.c:511–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511int doFlushWrite(xsSocket xss)
512{
513 int ret;
514
515 WSAAsyncSelect(xss->skt, xss->window, WM_CALLBACK, kSocketAsyncSelectEvents);
516
517 ret = send(xss->skt, xss->writeBuf, xss->writeBytes, 0);
518 if (ret < 0)
519 return -1;
520
521 modInstrumentationAdjust(NetworkBytesWritten, ret);
522
523 if (ret > 0) {
524 if (ret < xss->writeBytes)
525 c_memcpy(xss->writeBuf, xss->writeBuf + ret, xss->writeBytes - ret);
526 xss->writeBytes -= ret;
527 xss->unreportedSent += ret;
528 }
529
530 return 0;
531}
532
533void xs_socket_suspend(xsMachine *the)
534{

Callers 1

xs_socket_writeFunction · 0.70

Calls 1

sendFunction · 0.85

Tested by

no test coverage detected