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

Function doFlushWrite

modules/network/socket/qca4020/modSocket.c:783–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781}
782
783int doFlushWrite(xsSocket xss)
784{
785 int ret;
786
787 ret = send(xss->skt, (char*)xss->writeBuf, xss->writeBytes, 0);
788 if (ret < 0)
789 return -1;
790
791 modInstrumentationAdjust(NetworkBytesWritten, ret);
792
793 if (ret > 0) {
794 if (ret < xss->writeBytes) {
795 xss->writeBytes -= ret;
796 return -1;
797 }
798 xss->writeBytes -= ret;
799 modMessagePostToMachine(xss->the, NULL, 0, socketWritten, xss);
800 }
801
802 return 0;
803}
804
805// to accept an incoming connection: let incoming = new Socket({listener});
806void xs_listener(xsMachine *the)

Callers 1

xs_socket_writeFunction · 0.70

Calls 2

sendFunction · 0.85
modMessagePostToMachineFunction · 0.50

Tested by

no test coverage detected