| 509 | } |
| 510 | |
| 511 | int 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 | |
| 533 | void xs_socket_suspend(xsMachine *the) |
| 534 | { |
no test coverage detected