PipeIO
SnoopIO
StubIO
TCPIPIO


Name:
PipeIO

Description:
Implementation of IO using pipes.

Options:

Overview
Option Default Values Short Description Example(s)
ReadTimeout 60 n seconds or -1 (no timeout) Timeout on reading ReadTimeout 45
WriteTimout 60 n seconds or -1 (no timeout) Timeout on writing WriteTimeout 45
NoYield - Read|Write Do not yield to other threads NoYield="Read"
- in the default indicates no default
+ in the default indicates the field is mandatory

Description of Options

ReadTimeout
The timeout for reading data. A value of -1 specifies no timeout (infinite wait).
WriteTimeout
Specifies the timeout for writing data. A value of -1 specifies no timeout (infinite wait).
NoYield
Forces the program to block on reading or writing IO into the pipe. The default behaviour is to allow yield processing to other threads if the IO action would block. Some uses of this IO object require no latency on reading or sending data. An example is reading the response from a CGI program. Specifies the timeout for writing data. A value of -1 specifies no timeout (infinite wait).

Returns:
PIAPI_COMPLETED on success. PIAPI_ERROR and PIAPI_ABORT respectively for generic and severe error conditions.

Example:

	<Object>
		Name PipeIO
		Class PipeIOClass
		ReadTimeout 45
		WriteTimeout -1
	</Object>
	

:


Name:
SnoopIO

Description:
Acts as a link in an IO chain and monitors construction and destruction of IO objects as well as IO transactions.

Options:

Overview
Option Default Values Short Description Example(s)
IOObject + Object name Lower level IO object IOObject="TCPIPIOObject"
OutFile + <filename> An output filename OutFile="../Logs/snoop.txt"
- in the default indicates no default
+ in the default indicates the field is mandatory

Description of Options

IOObject
Lower level IO object which will be loaded to monitor traffic through this IO layer.
OutFile
A file to write IO transaction debugging information to. The path should be absolute or relative to the current directory.

Returns:
PIAPI_COMPLETED on success. PIAPI_ERROR and PIAPI_ABORT respectively for generic and severe error conditions.

Example:


	<Object>
		Name SnoopIO
		Class SnoopIOClass
		IOObject DefaultIOObject
		OutFile "../Logs/snoop.log"
	</Object>

	

:


Name:
StubIO

Description:
This object 'fakes' an IO connection by feeding canned data to the reader. The canned data is read from files.

Options:

Overview
Option Default Values Short Description Example(s)
AcceptInterval 0 0, -1, n IO accept interval AcceptInterval 0
SendInterval 0 0, -1, n IO output interval SendInterval 0
Data + <filename> File data to read DataFile ./../tests/t2.tst #define KEY_CONF_ERRORAFTER "ErrorAfter"
HTTPEquiv + <variable>: <value> Variable value pair for DB HTTPEquiv="RemoteAddr: 127.0.0.1"
ErrorAfter + <number> Number of child IO objects to error after ErrorAfter="10000"
- in the default indicates no default
+ in the default indicates the field is mandatory

Description of Options

AcceptInterval
Specify an interval measured in seconds to wait everytime a new connection is generated by copying the prototype IO object.
SendInterval
Specify an interval measured in seconds to wait everytime data is sent.
DataFile
Specifies a file with data to return to the reader. The file path should be absolute or relative to the current directory. This parameter can be specified multiple times to specify different files that will be assigned to different readers in cycles.
HTTPEquiv
Specifies an RFC822 variable value pair to put in this objects DB.
ErrorAfter
Specify the number of IO error objects to to error after. This facilites can be used to test the server for a discrete number of IO requests before exiting.

Returns:
PIAPI_COMPLETED on success. PIAPI_ERROR and PIAPI_ABORT respectively for generic and severe error conditions.

Example:

	<Object>
		Name StubIO
		Class StubIOClass
		AcceptInterval 0
		SendInterval 0
		DataFile ./../tests/t2.tst
	</Object>
	

:


Name:
TCPIPIO

Description:
This object encapsulates TCP/IP based IO communication.

Options:

Overview
Option Default Values Short Description Example(s)
Type Passive "Passive", "Active" A Pi3 object Type "Passive"
BindPort + (passive only) 1..n local port BindPort 8080
BindHost + (passive only) nnn.nnn.nnn.nnn or host.org.dom local host BindHost "localhost"
AcceptTimeout 360 n seconds or -1 (infinite) Timeout on accept AcceptTimeout -1
RecvTimeout - n seconds or -1 (infinite) Timeout on receive RecvTimeout 45
SendTimeout - n seconds or -1 (infinite) Timeout on send SendTimeout 30
PeerAddressVariable - <db type>:<name> Variable to hold Peer IP address PeerAddressVariable "STRING:RemoteAddr"
PeerHostNameVariable - <db type>:<name> Variable to hold Peer hostname PeerHostNameVariable "STRING:RemoteHost"
LocalAddressVariable - <db type>:<name> Variable to hold local IP address LocalAddressVariable "STRING:LocalAddr"
AcceptLockFile - <filename> File containing lock filename AcceptLockFile "Logs/lockfile.txt"
Flags 0 (no flags set) "OwnDB" | "SetPeerAddress" | "DNSReverseLookup" Flags which effect operation Flags "OwnDB|SetPeerAddress|DNSReverseLookup"
- in the default indicates no default
+ in the default indicates the field is mandatory

Description of Options

Type
Specify whether child objects the prototype IO object will be an active (client) or passive (server) socket.
BindPort
The local port to listen on for passive sockets.
BindHost
The local IP address or hostname of the network interface to listen on passive sockets.
AcceptTimeout
Accept timeout for passive sockets, a value of -1 specifies no timeout.
RecvTimeout
Timeout on receiving data for active and passive sockets. A value of -1 specifies no timeout.
SendTimeout
Timeout on sending data for active and passive sockets. A value of -1 specifies no timeout.
PeerAddressVariable
The variable name with which to set the ip address of the remote peer if the 'SetPeerAddress' flag is set.
PeerHostNameVariable
The variable name with which to set the hostname of the remote peer if the 'SetPeerAddress' and 'DNSReverseLookup' flags are set.
LocalAddressVariable
The variable name with which to set the local IP address of the socket if the 'SetLocalAddress' flag is set.
AcceptLockFile
The path to a file containing the lockfile for this server. The lockfile is used to synchronization accepting of new connection amoungst a group of processes listening for connections on the same file descriptor. Note this is only applicable to POSIX operating systems where the fork() system call may have been invoked to spawn a single process with a single listening file descriptor into multiple processes with multiple copies of the same file descriptor.
Flags
This options allows various options to be enabled and disabled. The value of the option takes the form of a sequence of value seperated by the '|' character. The values have the following significance. "OwnDB" | "SetPeerAddress" | "DNSReverseLookup"
Flags
Value Meaning
OwnDB Each child object will create its own DB
SetPeerAddress On creation, each child socket will get the IP address of its remote peer and place it in the DB with the variable name specified with the 'PeerAddressVariable' option.
DNSReverseLookup When the IP address of the remote peer is retrieved the hostname of the peer will be found and placed in the DB with the variable name specified by the 'PeerHostNameVariable' option.
SetLocalAddress On creation, each child socket will store its local IP address in the variable specified by the 'LocalAddressVariable' parameter.

Returns:
PIAPI_COMPLETED on success. PIAPI_CONTINUE if no action taken. PIAPI_ERROR and PIAPI_ABORT respectively for generic and severe error conditions.

Example:


	<Object>
		Name DefaultTCPIPIOObject
		Class TCPIPIOClass
		BindHost localhost
		BindPort 80
		Type Passive
		AcceptTimeout -1
		RecvTimeout 30
		SendTimeout 60 
		PeerAddressVariable "STRING:RemoteAddr"
		PeerHostNameVariable "STRING:RemoteHost"
		LocalAddressVariable "STRING:LocalAddr"
		Flags "OwnDB|SetLocalAddress|SetPeerAddress|DNSReverseLookup"
	</Object>