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



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

Socket

Create new socket

Declaration

Source position: socketsh.inc line 179

function Socket(

  Domain: LongInt;

  SocketType: LongInt;

  Protocol: LongInt

):LongInt;

Description

Socket creates a new socket in domain Domain, from type SocketType using protocol Protocol. The Domain, Socket type and Protocol can be specified using predefined constants (see the section on constants for available constants) If succesfull, the function returns a socket descriptor, which can be passed to a subsequent Bind call. If unsuccesfull, the function returns -1.

for an example, see Accept.

Errors

Errors are returned in SocketError, and include the follwing:

SYS_EPROTONOSUPPORT
The protocol type or the specified protocol is not supported within this domain.
SYS_EMFILE
The per-process descriptor table is full.
SYS_ENFILE
The system file table is full.
SYS_EACCESS
Permission to create a socket of the specified type and/or protocol is denied.
SYS_ENOBUFS
Insufficient buffer space is available. The socket cannot be created until sufficient resources are freed.

See also

SocketPair

  

Create socket pair

Notes

 No notes exist for this page yet. 





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