Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodtAbstractSocket.Send

function Send(var aBuf; aCount: Integer; aErrorCode: PInteger = nil): Integer; virtual; abstract;
Writes outgoing bytes on a connected socket, client or server side alike; aErrorCode lets the caller handle a broken connection without an exception. Same three outcomes as Receive, except that 0 here means "the socket is gone", not an orderly close:
< 0 with aErrorCode^ = 0 is a would-block, i.e. the kernel buffer is full - wait on WaitForWrite and retry with the SAME bytes rather than treating it as an error. SendAll does exactly that.