set configuration options on a socket connection - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Connectivity : Web Features : Network Communication : Sockets Package : Sockets/Configure

Sockets[Configure] - set configuration options on a socket connection

Calling Sequence

Configure(sid, options)

Parameters

sid

-

valid open socket ID

options

-

(optional) sequence of option names or equations

Description

• 

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.

Configuration Options

• 

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.

Examples

withSockets:

sid:=Openlocalhost,echo

0

(1)

Configuresid

Configuresid,'buffer'

21960

(2)

Configuresid,'buffer'=200

21960

(3)

Configuresid,'buffer'

4608

(4)

Configuresid,'buffer','warm'

4608,false

(5)

Configuresid,'buffer'=1024,'warm'=true

4608,false

(6)

See Also

socket definition, Sockets, Sockets[Open]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam