| 781 | } |
| 782 | |
| 783 | int 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}); |
| 806 | void xs_listener(xsMachine *the) |
no test coverage detected