IP Item Attributes

From STX Wiki
Jump to navigationJump to search
IP Item
NEW SET ATTRIBUTES MESSAGES PROTOCOLS

The ip shell item has the following attributes:

!CONNECTIONS

The !CONNECTIONS ip item attribute returns a semi-colon separated list of ip connections. Each connection contains the following information:

socketid localaddress localport remoteaddress remoteport protocol status nmessages

Where socketid is the unique id string identifying the connection. This is necessary for server instances, which must use a socket id with SEND and RECEIVE commands.

Where localaddress, localport, remoteaddress, remoteport are hopefully self-explanatory.

Where protocol refers to the connection protocol.

Where status is either "open" or "closed", depending on whether the socket is connected or not.

Where nmessages is the number of message which have been received by the socket and not yet retrieved by the shell. Messages are retrieved using the RECEIVE command.

Note that if the ip instance is using the UDP protocol, no connections are shown, since UDP is a connectionless protocol.

!EMSG

The !EMSG ip item attribute returns the last error message.

!LADDR

The !LADDR ip item attribute returns the local ip address this instance is using.

!LPORT

The !LPORT ip item attribute returns the local port number this instance is using. This is either the port specified with the LISTEN command for a local server, or the port assigned by a remote server.

!MESSAGES

The ip item's !MESSAGES attribute returns a list of details about queued messages. Messages received by a socket are queued until a RECEIVE command is performed to retrieve the message. Unless a socket id is specified, the !MESSAGES attribute lists all messages for all sockets. The messages for different sockets are separated by a colon. The messages for one specific socket are separated by a semi-colon. The first entry in a socket's list is the socket id itself. The other entries are protocol/byte pairs E.g.:

socket#1 ; stx 55 : socket#2 ; stx 44 ; unknown 34

There are three messages in the queue. The first message arrived on socket#1 and uses the STx ip protocol. The second and third messages arrived on socket#2. eusing the STx ip protocol and is 55 bytes long. The second is 21 bytes long and uses an unknown protocol. The first of these uses the stx protocol, the second uses an unknown protocol and will be treated as a string.

!PROTOCOL

The !PROTOCOL ip item attribute returns the TCP/IP protocol this instance is using (either "TCP" or "UDP").

!RADDR

The !RADDR ip item attribute returns the remote ip address this instance is connected to.

!RC

The !RC ip item attribute returns the last error code. >10000 for Microsoft specific socket errors or –1 for STx internal errors.

!READY

The !READY ip item attribute returns 1 if the client is connected, otherwise it returns 0. This is not a super attribute and will probably be removed/replaced.

!RPORT

The !RPORT ip item attribute returns the remote port number this instance is connected to.

!SERVER

The !SERVER ip item attribute returns 1 if this instance is acting as a server (i.e. listening) or 0 if it is a client (default).

Navigation menu

Personal tools