SocketAttribs
(Engine-Level Function)
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 | LargeSocketWrite |
Format: | SocketAttribs(Stream, Option [,FilterID, Opcode , Data]) |
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:
|
||||||||||||||||||||||||||||||||||||||||||||
FilterID | ||||||||||||||||||||||||||||||||||||||||||||
Optional text. Set to "WSKT" for WebSockets. | ||||||||||||||||||||||||||||||||||||||||||||
OpCode | ||||||||||||||||||||||||||||||||||||||||||||
Optional numeric. Refer to the list in the comments. | ||||||||||||||||||||||||||||||||||||||||||||
Data | ||||||||||||||||||||||||||||||||||||||||||||
Optional text. Refer to the list in the comments. |
Comments: |
Used to determine the size of the output buffer limit on a socket, modify it and obtain the amount of data currently in the output buffers (i.e. not transmitted). 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. If using option 13 to activate optional filters, note that (as of VTScada version 12.1) TLS/SSL and WebSocket are the only ones supported. Option 19 provides control operations for protocol filters that support this: FilterID = "WSKT" Opcode == 0 (Activate). Opcode == 1 (Max Rx Time). Opcode == 2 (Ping time). Opcode == 3 (Close time). Opcode == 4 (Tx Max Frame Size). FilterID = "RAW" Opcode == 0 Data == Maximum size of the output buffer for the socket, in bytes. If more data than this is pending transmission from the output buffer, the socket will be closed and the stream will go Invalid. |