SocketAttribs

Description: Returns information about a TCP/IP socket's attributes.
Returns: Text or Buffer (see comments)
Usage: Script Only.
Function Groups: Stream and Socket
Related to: ClientSocket | CloseStream | ServerSocket | SocketAttribs | SocketServerEnd | SocketServerStart | SocketWait | SRead | StreamEnd | SWrite |
Format: SocketAttribs(Stream, Option)
Parameters:  
Stream
Required. Any stream expression for the socket. If this isn't a socket stream, invalid is returned.
Option
Required. Any numeric expression for the desired attribute:

Option

Attribute

0

Remote (text) workstation name

1

Remote port number

2

Remote workstation IP

3

Local machine name

4

Local machine IP

5

Number of bytes in the output buffer

6

Remote (text) workstation name (buffered)

7

Remote workstation IP (buffered)

8

Local machine name (buffered)

9

Local machine IP (buffered)

10

Remote machine Name (for incoming UDP datagrams)

11

Remote Port (for incoming UDP datagrams)

12

Remote IP (for incoming UDP datagrams)

13Activate optional filters specified in ClientSocket()
14UDP local port number
15Socket type (0 TCP, 1 UDP)
16UDP destination IP
17UDP is broadcast flag
18Structure containing counters and timestamps of bytes transmitted and received.
Comments:

The return value for options 0 and 6 is the machine name stored as a text value. If the name cannot be found it will return the internet address of the socket as a text string.
Options 6 through 9 differ from options 0 and 2 through 4 only in the fact that they are buffered. This means that an initial inquiry will be made to the operating system and stored in a buffer, and after that, all inquiries will be handed the value stored in the buffer. This makes options 6 through 9 significantly faster than the other options, however, any online changes to the workstation's attributes will be not be discovered by options 6 to 9, only 0 and 2 to 4 would return the new values.

If using option 13 to activate optional filters, note that (as of VTScada version 11) TLS/SSL is the only one supported.