IRISLIB database
SocketCommon Class Reference

Common class members to both Socket and ServerSocket. More...

Inheritance diagram for SocketCommon:

Public Member Functions

 Flush (_.Library.Status pSC)
 Ensure that any data already written to the TCP buffer are actually sent to the remote partner.
 
_.Library.String Read (_.Library.Integer pMaxReadLen, _.Library.Numeric pTimeout, _.Library.Status pSC)
 Read until pMaxReadLen chars are gotten or pTimeout expires. More...
 
_.Library.String ReadAny (_.Library.Integer pMaxReadLen, _.Library.Numeric pTimeout, _.Library.Status pSC)
 Return as soon as any data arrives, or timeout expires, or MaxReadLen is reached.
 
_.Library.String ReadLine (_.Library.Integer pMaxReadLen, pTimeout, _.Library.Status pSC, _.Library.String pLineTerminator)
 Read until pMaxReadLen chars are gotten, pTimeout expires, or a LineTerminator character is encountered. More...
 
 Write (_.Library.String pData, _.Library.Boolean pFlush, _.Library.Status pSC)
 Write pLine to the stream buffer, followed by the current LineTerminator characters. More...
 

Static Public Member Functions

_.Library.Status GetLocalInterfaces (pResults)
 Get a list of link-local interface addresses. More...
 

Public Attributes

 AtEnd
 Override InitialExpression. More...
 
 DisconnectHandler
 Object on which to call OnDisconnect() when a connection is lost. More...
 
 InputBufferSize
   More...
 
 KeepAliveInterval
 Connection-specific TCP keepalive interval in seconds. More...
 
 LineTerminator
 Override InitialExpression. More...
 
 LocalInterface
 In a multi-homed system, specify which local network interface the TCP connection should go through. More...
 
 OutputBufferSize
   More...
 
 Port
   More...
 
 Remote
 The IP address and port of the remote end of the socket connection. More...
 
 SSLConfig
 The name of an existing SSL/TLS system configuration set to use (Secure Socket Layer / Transport Layer Security, configured via the system portal's Security Management page). More...
 
 TCPReceiveBuffer
 Control the size, in bytes, of the TCP Receive Buffer (SO_RCVBUF) for the TCP device. More...
 
 TCPSendBuffer
 Control the size, in bytes, of the TCP Send Buffer (SO_SNDBUF) for the TCP device. More...
 

Detailed Description

Common class members to both Socket and ServerSocket.

Member Function Documentation

◆ GetLocalInterfaces()

_.Library.Status GetLocalInterfaces (   pResults)
static

Get a list of link-local interface addresses.

The output argument is an integer-subscripted array of local interface IP addresses. They may be IPv4 or IPv6 addresses. On LINUX systems the address will be suffixed with the name of the interface (e.g. eth0).

After the IP address each list entry contains a space followed by, in parentheses, the text "IPv4" or "IPv6" depending on the type of interface, a space, and then the full name of the interface.

This entry may be set directly into the LocalInterface property of this class but only the IP address portion will be used in the binding of the socket to local network interfaces.

To be able to bind to IPv6 interfaces you may need to enable IPv6. This is done in the Management Portal by going to System Administration / Configuration / Additional Settings / Startup and editing the IPv6 setting.

◆ Read()

_.Library.String Read ( _.Library.Integer  pMaxReadLen,
_.Library.Numeric  pTimeout,
_.Library.Status  pSC 
)

Read until pMaxReadLen chars are gotten or pTimeout expires.

On return, if pTimeout=0 it means no timeout occurred and the returned string contains the full pMaxReadLen characters. If pTimeout is unchanged it means the full timeout period expired before encountering pMaxReadLen chars and the returned string is shorter than pMaxReadLen.

◆ ReadLine()

_.Library.String ReadLine ( _.Library.Integer  pMaxReadLen,
  pTimeout,
_.Library.Status  pSC,
_.Library.String  pLineTerminator 
)

Read until pMaxReadLen chars are gotten, pTimeout expires, or a LineTerminator character is encountered.

On return, if pTimeout=0 it means no timeout occurred. If pTimeout=0 and the returned string contains the full pMaxReadLen characters, it means no LineTerminator was encountered yet, even if the following character would be a LineTerminator. If pTimeout=0 and the returned string is shorter than pMaxReadLen, then a LineTerminator was encountered. If pTimeout is unchanged it means the full timeout period expired before encountering a LineTerminator character or pMaxReadLen chars and the returned string is shorter than pMaxReadLen. On return, pLineTerminator contains the encountered LineTerminator character(s) if any.

◆ Write()

Write ( _.Library.String  pData,
_.Library.Boolean  pFlush,
_.Library.Status  pSC 
)

Write pLine to the stream buffer, followed by the current LineTerminator characters.

If pFlush is True, ensure that the characters are actually sent to the stream.

Member Data Documentation

◆ AtEnd

AtEnd

Override InitialExpression.

 

◆ DisconnectHandler

DisconnectHandler

Object on which to call OnDisconnect() when a connection is lost.

 

◆ InputBufferSize

InputBufferSize

 

 

◆ KeepAliveInterval

KeepAliveInterval

Connection-specific TCP keepalive interval in seconds.

A setting of -1 means KeepAlive

should be disabled entirely. InterSystems IRIS supports per socket keepalive on Windows and Linux, so this setting is ignored on other platforms. The default value of 0 will use the current system-wide TCP keepalive interval. Valid settings are -1, to disable keepalive entirely, and between 0 seconds and 432000 seconds (5 days), where positive values less than 30 will be treated as a 30 second interval.  

◆ LineTerminator

LineTerminator

Override InitialExpression.

 

◆ LocalInterface

LocalInterface

In a multi-homed system, specify which local network interface the TCP connection should go through.

An empty value means use any interface. See GetLocalInterfaces() to enumerate available choices.

 

◆ OutputBufferSize

OutputBufferSize

 

 

◆ Port

Port

 

 

◆ Remote

Remote

The IP address and port of the remote end of the socket connection.

Time and IP address and port (and disconnect time) of the last connected remote socket  

◆ SSLConfig

SSLConfig

The name of an existing SSL/TLS system configuration set to use (Secure Socket Layer / Transport Layer Security, configured via the system portal's Security Management page).

May include a certificate password after a '|' character for inbound connections.

 

◆ TCPReceiveBuffer

TCPReceiveBuffer

Control the size, in bytes, of the TCP Receive Buffer (SO_RCVBUF) for the TCP device.

This should be used in conjunction with <property>TCPSendBuffer</property> to increase the TCP window as per RFC1323. The primary use case is in situations with high latency or bandwidth, where the default sizes of the respective buffers may constrain throughput. The default value of 0 will use the OS default setting.  

◆ TCPSendBuffer

TCPSendBuffer

Control the size, in bytes, of the TCP Send Buffer (SO_SNDBUF) for the TCP device.

This should be used in conjunction with <property>TCPReceiveBuffer</property> to increase the TCP window as per RFC1323. The primary use case is in situations with high latency or bandwidth, where the default sizes of the respective buffers may constrain throughput. The default value of 0 will use the OS default setting.