Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Wildcard Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Sockbase Source Code
 previous   up   next 

Types
socketAddress
Abstract data type to store socket addresses.

socketAddress

const type: socketAddress

Abstract data type to store socket addresses.


Function Summary
integer
compare (in socketAddress: addr1, in socketAddress: addr2)
Compare two socket addresses.
integer
hashCode (in socketAddress: address)
Compute the hash value of a socket address.
string
numericAddress (in socketAddress: address)
Get the numeric (IP) address of the host at address.
socketAddress
inetSocketAddress (in string: hostName, in integer: port)
Create an internet socket address of a port at a host.
socketAddress
inetSocketAddress (in integer: port)
Create an internet socket address of a port at localhost.
socketAddress
inetListenerAddress (in integer: port)
Create an internet listener socket address of a port at localhost.
string
getHostname
Determine the hostname.
void
connect (in PRIMITIVE_SOCKET: aSocket, in socketAddress: address)
Connect aSocket to the given address.
PRIMITIVE_SOCKET
accept (in PRIMITIVE_SOCKET: listenerSocket, inout socketAddress: address)
Create a new accepted connection socket for listenerSocket.
void
bind (in PRIMITIVE_SOCKET: listenerSocket, in socketAddress: address)
Assign the specified address to the listenerSocket.
void
listen (in PRIMITIVE_SOCKET: listenerSocket, in integer: backlog)
Listen for socket connections and limit the incoming queue.

Function Detail

compare

const func integer: compare (in socketAddress: addr1, in socketAddress: addr2)

Compare two socket addresses.

Returns:
-1, 0 or 1 if the first argument is considered to be respectively less than, equal to, or greater than the second.

hashCode

const func integer: hashCode (in socketAddress: address)

Compute the hash value of a socket address.

Returns:
the hash value.

numericAddress

const func string: numericAddress (in socketAddress: address)

Get the numeric (IP) address of the host at address. IPv4 addresses return the socketAddress in dot notation (e.g.: "192.0.2.235") and IPv6 addresses return the socketAddress in colon notation (e.g.: "fe80:0:0:0:202:b3ff:fe1e:8329").

Returns:
the IP address of the specified host.

inetSocketAddress

const func socketAddress: inetSocketAddress (in string: hostName, in integer: port)

Create an internet socket address of a port at a host. The hostName is either a host name (e.g.: "www.example.org"), or an IPv4 address in standard dot notation (e.g.: "192.0.2.235"). Operating systems supporting IPv6 may also accept an IPv6 address in colon notation.

Returns:
the internet socket address or socketAddress.value when the host cannot be found.
Raises:
FILE_ERROR - A system function returns an error.
RANGE_ERROR - The port is not in the range 0 to 65535 or hostName cannot be converted to the system string type.
MEMORY_ERROR - Not enough memory to convert hostName. to the system representation or not enough memory to represent the result.

inetSocketAddress

const func socketAddress: inetSocketAddress (in integer: port)

Create an internet socket address of a port at localhost.

Returns:
the internet socket address.
Raises:
FILE_ERROR - A system function returns an error.
RANGE_ERROR - The port is not in the range 0 to 65535.
MEMORY_ERROR - Not enough memory to represent the result.

inetListenerAddress

const func socketAddress: inetListenerAddress (in integer: port)

Create an internet listener socket address of a port at localhost.

Returns:
the internet listener socket address.
Raises:
FILE_ERROR - A system function returns an error.
RANGE_ERROR - The port is not in the range 0 to 65535.
MEMORY_ERROR - Not enough memory to represent the result.

getHostname

const func string: getHostname

Determine the hostname.

Returns:
the hostname.
Raises:
MEMORY_ERROR - Not enough memory to represent the result.

connect

const proc: connect (in PRIMITIVE_SOCKET: aSocket, in socketAddress: address)

Connect aSocket to the given address.

Raises:
FILE_ERROR - A system function returns an error.

accept

const func PRIMITIVE_SOCKET: accept (in PRIMITIVE_SOCKET: listenerSocket, inout socketAddress: address)

Create a new accepted connection socket for listenerSocket. The function waits until at least one connection request is in the sockets queue of pending connections. Then it extracts the first connection request from the sockets queue. This request is accepted and a connection socket is created for it.

Returns:
the accepted connection socket.
Raises:
FILE_ERROR - A system function returns an error.
MEMORY_ERROR - An out of memory situation occurred.

bind

const proc: bind (in PRIMITIVE_SOCKET: listenerSocket, in socketAddress: address)

Assign the specified address to the listenerSocket.

Parameters:
address - An internet listener socket address.
Raises:
FILE_ERROR - A system function returns an error.

listen

const proc: listen (in PRIMITIVE_SOCKET: listenerSocket, in integer: backlog)

Listen for socket connections and limit the incoming queue. The backlog argument defines the maximum length to which the queue of pending connections for listenerSocket may grow.

Raises:
FILE_ERROR - A system function returns an error.


 previous   up   next