SocketAttribs

Description:              This function returns information about a TCP/IP socket's attributes.

Returns:                    Nothing

Usage:                   Script

Format:                      SocketAttribs(Stream, Option)

Parameters:             Stream     { Stream }  { required }  { no default: }

                                                Any stream expression for the socket. If this isn't a socket stream, invalid is returned.

                                    Option     { numeric }  { required }  { no default: }

                                                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)

 

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.

See Also:

ClientSocket | CloseStream | ServerSocket | SocketAttribs | SocketServerEnd | SocketServerStart | SocketWait | SRead | StreamEnd | SWrite | TCPIPReset