With select, I can determine if any bytes can be received or sent without blocking.
With this function, I can determine how many bytes can be received:
function BytesAvailable(S: TSocket): Integer; begin if ioctlsocket(S, FIONREAD, Result) = SOCKET_ERROR then Result := -1; end;
Is there a way to determine how many bytes can be sent?
Therefore, I can be sure that when I call send with N bytes, it will return exactly N bytes (or SOCKET_ERROR), but not less (the send buffer is full).
FIONWRITE is not available for Winsock.
tim93 source share