Back to Ponyc

pony_os_writev_max() is shared by packages/net and packages/files, and on Windows net now does a real WSASend

.known-couplings/writev-max-net-files.md

0.66.0895 B
Original Source

pony_os_writev_max() is shared by packages/net and packages/files, and on Windows net now does a real WSASend

pony_os_writev_max() (src/libponyrt/lang/socket.c) returns 1 on Windows and is read by both packages/net (TCPConnection) and packages/files (File) to decide how many buffers a single gather-write may carry. On Windows net's pony_os_writev now performs a real WSASend over a WSABUF array built from the caller's (ptr, len) buffers, but file.pony's Windows write branch does a single-buffer write keyed off the same cap. Raising pony_os_writev_max above 1 on Windows would make file.pony hand a multi-buffer total to a single-buffer write and over-read past the first buffer. Keep the Windows cap at 1 unless both consumers are updated together. Run on a Windows host: make test (stdlib-debug and stdlib-release — the net and files suites).