Sockets
Configure
set configuration options on a socket connection
Calling Sequence
Parameters
Description
Configuration Options
Examples
Configure(sid, options)
sid
-
valid open socket ID
options
(optional) sequence of option names or equations
A number of low level options on an open socket connection can be queried or modified by calling the procedure Configure. The argument sid is a valid and open socket ID that identifies the socket connection to be configured.
Following the sid argument, you can specify a sequence of names of valid options or equations of the form optionName = optionVal, where optionName is a valid option name and optionVal is a valid value for that configuration option. See Configuration Options below for information about valid names and options.
An option name appearing by itself is treated as a query for the current value of that option. An equation is treated as a request to set the value of an option to the value on the right-hand side of the equation. The value must be a valid for the corresponding option.
The value returned by Configure is an expression sequence whose length is equal to the number of arguments passed in the call after the sid argument (one for each option argument). The i-th entry in the returned expression sequence is the previous value of the configuration option named in the i+1-st argument.
The following table indicates the supported options, their default values, the type of a valid value, and any relevant units.
Option
Default
Valid
Units
warm
false
true/false
buffer
system dependent
posint
bytes
timeout
-1
nonnegint
seconds
The warm Option
The warm option is normally not set. However, if warm is set, it requests the system to "keep the connection warm" so that it is not dropped after periods of inactivity.
The buffer Option
The buffer option is used to configure the buffer size used by the underlying TCP/IP implementation for the indicated socket. This option affects the size of the buffer used for both sending and receiving. (There is currently no mechanism for configuring these independently.) The default buffer size is system dependent, as are the minimum and maximum sizes that can be configured.
The timeout Option
The timeout option is used to implement the persistent timeout protocol. Its default value is −1, which indicates that no persistent timeout has been configured on the connection. Setting timeout to any non-negative integer value will set a persistent timeout on the connection, affecting the blocking behavior of read operations on the socket.
with⁡Sockets:
sid≔Open⁡localhost,echo
0
Configure⁡sid
Configure⁡sid,buffer
87040
Configure⁡sid,buffer=200
4608
Configure⁡sid,buffer,warm
4608,false
Configure⁡sid,buffer=1024,warm=true
See Also
socket definition
Sockets[Open]
Download Help Document