<<

Contents

Search

>>

 

SERVER_SOCKET

 

 

Function

 

 

Syntax:

SERVER_SOCKET(<Port>,<SSL>,<Macro Name>[,<IP-Address>])

 

<Port>

= <NUM-EXPRESSION>

<SSL>

= <NUM-EXPRESSION>

<Macro Name>

= <MACRONAME>

<IP-Address>

= <STRING-EXPRESSION>

 

 

Meaning:

Opens a server socket at port <Port>.

 

If <SSL> <> 0, a secure SSL connection is established.

 

For each Client connection coming in at the port <Port> the Macro <Macroname> is executed. Note that with several Client connections the Macro <Macroname> is simultaneously executed several times!

 

SERVER_SOCKET returns the handle for the Server Socket if no error occurred, otherwise –1.

 

In the case of an error the variable ERRORTEXT$ contains the error report.

 

Parameter:

Port

Number of port

SSL

<> 0: A secure SSL connection is established.

Macro Name

Name of macro which is executed at an incoming client connection.

IP-Address

Specifies the IP address on which the server socket is running.

 

Sample:

HANDLE% = SERVER_SOCKET(2000,1,SERVER.SOCKET.MACRO)

IF HANDLE% = -1

THEN … Error …

ENDIF

 

See also:

SERVER_SOCKET_READ$

SERVER_SOCKET_SET_TIMEOUT

SERVER_SOCKET_WRITE

SERVER_SOCKET_GET_CLIENT_ADDRESS$

CLOSE_SOCKET

CLIENT_SOCKET