11 getsockopt% function – Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual

Page 120

Advertising
background image

8Ć10

8.11

GETSOCKOPT% Function

Format:

GETSOCKOPT%( sn%, opnum%, opval% )

where:

sn%

is the number of socket whose option you want to

read.

opnum%

is the number of the option to read.

opval%

is the name of the option variable where the current

value is written.

This function is used to examine what modes of operation are

selected. OPNUM% selects which option to look at, and OPVAL%

displays the current status.
Options

OPNUM% OPVAL% Description

Keep Alive

0008h

0

Keep alive is disabled

ą(Default)

1

Keep alive is enabled

This option is only used on TCP sockets. When enabled, the ENI will

periodically send an empty message to maintain the connection. If

this option is not used and a frame is not received within 8 minutes,

the ENI will assume it has been broken.
Linger

0080h

0

Linger is disabled

ą(Default)

1

Linger is enabled

This option is only used on TCP sockets to select how the SHUTĆ

DOWN function will operate. When linger is enabled and there are

messages in any transmit or receive queues the ENI will process

those messages before doing the shutdown.
Non Blocking 0200h

0

Non Blocking is disabled

ăă(Default)

1

Non Blocking is enabled

This option is used to select how the RECV% and RECVL% function

will operate. If Non Blocking is enabled and no message has arrived

for the RECV% or RECVL%, control is returned to the application

program and an error code Ć101 is returned by the RECV% or

RECVL%.
Connected

0800h

0

Socket not connected

1

Socket connected

This option is only used on TCP sockets. It allows the application

program to test if a connection is established without doing a

SEND% or RECV%.
Values Returned:
ă1

Success

-2

ENI not initialized

-6

did not get option

-9

No buffer space

-15 Bad socket number

-20 Bad option number

-100 No buffer space

Advertising
This manual is related to the following products: