[Overview][Constants][Types][Procedures and functions][Variables] Reference for unit 'Sockets' (#rtl)

Send

Send data through socket

Declaration

Source position: socketsh.inc line 177

function Send(

  Sock: LongInt;

  const Buf;

  BufLen: LongInt;

  Flags: LongInt

):LongInt;

Description

Send sends AddrLen bytes starting from address Addr to socket Sock. Sock must be in a connected state. The function returns the number of bytes sent, or -1 if a detectable error occurred.

Flags can be one of the following:

1
Process out-of band data.
4
Bypass routing, use a direct interface.

Errors

Errors are reported in SocketError, and include the following:

SYS_EBADF
The socket descriptor is invalid.
SYS_ENOTSOCK
The descriptor is not a socket.
SYS_EFAULT
The address is outside your address space.
SYS_EMSGSIZE
The message cannot be sent atomically.
SYS_EWOULDBLOCK
The requested operation would block the process.
SYS_ENOBUFS
The system doesn't have enough free buffers available.

See also

Recv

  

Receive data on socket