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

Function doFlushWrite

modules/network/socket/lin/modSocket.c:751–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

749}
750
751int doFlushWrite(xsSocket xss)
752{
753 int ret;
754
755 ret = send(xss->skt, (char*)xss->writeBuf, xss->writeBytes, 0);
756 if (ret < 0) {
757 return -1;
758 }
759
760 modInstrumentationAdjust(NetworkBytesWritten, ret);
761
762 if (ret > 0) {
763 if (ret < xss->writeBytes) {
764 xss->writeBytes -= ret;
765 return -1;
766 }
767 xss->writeBytes -= ret;
768 xss->unreportedSent += ret;
769 }
770
771 return 0;
772}
773
774void xs_socket_suspend(xsMachine *the)
775{

Callers 1

xs_socket_writeFunction · 0.70

Calls 1

sendFunction · 0.85

Tested by

no test coverage detected