IRISLIB database
TCPDevice Class Reference

The <class>SYSTEM.TCPDevice</class> class provides an interface for retrieving IP address and port of current TCP device. More...

Inheritance diagram for TCPDevice:
Collaboration diagram for TCPDevice:

Static Public Member Functions

_.Library.Integer GetDisconnectCode ()
 Get the O/S error that caused a <READ> or <WRITE> error due to peer disconnect or network error on a TCP device. More...
 
_.Library.String LocalAddr (_.Library.Integer Format)
 Get local IP address of current TCP device. More...
 
_.Library.String LocalAddrPort (_.Library.String Addr)
 Get local IP address and port number of current TCP device. More...
 
_.Library.String LocalPort ()
 Get local port number of current TCP device. More...
 
_.Library.String PeerAddr (_.Library.Integer Format)
 Get foreign IP address of current TCP device. More...
 
_.Library.String PeerAddrPort (_.Library.Integer Format)
 Get foreign IP address and port number of current TCP device. More...
 
_.Library.String PeerPort ()
 Get foreign port number of current TCP device. More...
 
- Static Public Member Functions inherited from Help
_.Library.String Help (_.Library.String method)
 This is a helper class that is used by the various SYSTEM classes to provide a Help method. More...
 

Detailed Description

The <class>SYSTEM.TCPDevice</class> class provides an interface for retrieving IP address and port of current TCP device.


These interfaces support both IPV6 and IPV4 internet addresses.

Member Function Documentation

◆ GetDisconnectCode()

_.Library.Integer GetDisconnectCode ( )
static

Get the O/S error that caused a <READ> or <WRITE> error due to peer disconnect or network error on a TCP device.


The $IO must be a TCP device or $system.TCPDevice.GetDisconnectCode() generates a <FUNCTION> error.
The error returned will be 0 if the peer closed the TCP connection.

◆ LocalAddr()

_.Library.String LocalAddr ( _.Library.Integer  Format)
static

Get local IP address of current TCP device.



Parameters:
Format - The format of address to be returned. If this argument is omitted the default value is 0. The value could be:

  • 0: in text format, 'dotted' decimal string for IPV4, colon-hex address string for IPV6.
  • 1: in binary format, 4 character length for IPV4, 16 characters for IPV6.

Return:
Returns the local IP address associated with the TCP device. It could be in binary or text format depends on the Format parameter. For binary format the IP address is in Network order.
If the current device ($IO) is not a TCP device, it gets <FUNCTION> error.
If the TCP device is in 'listening' state, the IP address would be all zeros (INADDR_ANY).

◆ LocalAddrPort()

_.Library.String LocalAddrPort ( _.Library.String  Addr)
static

Get local IP address and port number of current TCP device.



Parameters:
Format - The format of address to be returned. If this argument is omitted the default value is 0. The value could be:

  • 0: in text format, 'dotted' decimal string for IPV4, colon-hex address string for IPV6.
  • 1: in binary format, 4 character length for IPV4, 16 characters for IPV6.

Return:
Returns the local IP address and port number associated with the TCP device. The IP address could be in binary or text format depends on the Format parameter. For binary format the IP address is in Network order.
If the current device ($IO) is not a TCP device, it gets <FUNCTION> error.
If the TCP device is in 'listening' state, the IP address would be all zeros (INADDR_ANY).
The return string is a List string with IP address in first and port number in second element.
The port number is a numberic string in Host order.

◆ LocalPort()

_.Library.String LocalPort ( )
static

Get local port number of current TCP device.



Return:
Returns the local port number associated with the TCP device. If the current device ($IO) is not a TCP device, it gets <FUNCTION> error.
The port number is a numberic string in Host order.

◆ PeerAddr()

_.Library.String PeerAddr ( _.Library.Integer  Format)
static

Get foreign IP address of current TCP device.



Parameters:
Format - The format of address to be returned. If this argument is omitted the default value is 0. The value could be:

  • 0: in text format, 'dotted' decimal string for IPV4, colon-hex address string for IPV6.
  • 1: in binary format, 4 character length for IPV4, 16 characters for IPV6.

Return:
Returns the foreign IP address associated with the TCP device. It could be in binary or text format depends on the Format parameter. For binary format the IP address is in Network order.
If the current device ($IO) is not a TCP device, it gets <FUNCTION> error.
If the TCP device is in 'listening' state or not connected to remote system, it returns a null string.

◆ PeerAddrPort()

_.Library.String PeerAddrPort ( _.Library.Integer  Format)
static

Get foreign IP address and port number of current TCP device.



Parameters:
Format - The format of address to be returned. If this argument is omitted the default value is 0. The value could be:

  • 0: in text format, 'dotted' decimal string for IPV4, colon-hex address string for IPV6.
  • 1: in binary format, 4 character length for IPV4, 16 characters for IPV6.

Return:
Returns the foreign IP address and port number associated with the TCP device. The IP address could be in binary or text format depends on the Format parameter. For binary format the IP address is in Network order.
If the current device ($IO) is not a TCP device, it gets <FUNCTION> error.
If the TCP device is in 'listening' state or not connected to remote system, it returns a null string.
The return string is a List string with IP address in first and port number in second element.
The port number is a numberic string in Host order.

◆ PeerPort()

_.Library.String PeerPort ( )
static

Get foreign port number of current TCP device.



Return:
Returns the foreign port number associated with the TCP device. If the current device ($IO) is not a TCP device, it gets <FUNCTION> error.
If the TCP device is in 'listening' state or not connected to remote system, it returns a null string.
The port number is a numberic string in Host order.