help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



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

Bind

Bind a socket to an address.

Declaration

Source position: line 0

function Bind(

  Sock: LongInt;

  const Addr;

  AddrLen: LongInt

):Boolean;

function Bind(

  Sock: LongInt;

  const addr: String

):Boolean;

Description

Bind binds the socket Sock to address Addr. Addr has length Addrlen. The function returns True if the call was succesful, False if not.

The form of the Bind command with the TUnixSockAddr is equivalent to subsequently calling Str2UnixSockAddr and the regular Bind function. The function returns True if successfull, False otherwise.

Errors

Errors are returned in SocketError and include the following:

SYS_EBADF
The socket descriptor is invalid.
SYS_EINVAL
The socket is already bound to an address,
SYS_EACCESS
Address is protected and you don't have permission to open it.

More arrors can be found in the Unix man pages.

See also

Socket

  

Create new socket

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505