smartinspectpython.sipipeprotocol
Used for sending packets to a local SmartInspect Console over a named pipe connection. This protocol only works on Windows-based systems, as it utilizes a Win32 API for named pipe access.
This class is used for sending packets through a local named pipe to the SmartInspect Console. It is used when the 'pipe' protocol is specified in the SmartInspect.Connections. Please see the IsValidOption method for a list of available protocol options. Please note that this protocol can only be used for local connections. For remote connections to other machines, please use SITcpProtocol.
For a list of available protocol options, please refer to the IsValidOption method.
Threadsafety:
The public members of this class are thread-safe.
Overridden. Fills a SIConnectionsBuilder instance with the options currently used by this protocol.
Arguments:
- builder (SIConnectionsBuilder): The SIConnectionsBuilder object to fill with the current options of this protocol.
Overridden. Connects to the specified local named pipe.
Raises:
- SIProtocolException: Establishing the named pipe connection failed.
This method tries to establish a connection to a local named pipe of a SmartInspect Console.
Overridden. Closes the connection to the specified local named pipe.
Raises:
- SIProtocolException: Closing the named pipe handle failed.
This method closes the named pipe handle if previously created and disposes any supplemental objects.
Tries to reconnect to the specified local named pipe.
Returns:
True if the reconnect attempt has been successful and false otherwise.
This method tries to re-establish a connection to the local named pipe of a SmartInspect Console.
Sends a packet to the Console.
Arguments:
- packet (SIPacket): The packet to write.
Raises:
- Exception: Sending the packet to the Console failed.
This method sends the supplied packet to the SmartInspect Console over the previously established named pipe connection.
Overridden. Validates if a protocol option is supported.
Arguments:
- name (str): The option name to validate.
Returns:
True if the option is supported and false otherwise.
The following table lists all valid options, their default values and descriptions for the PIPE protocol.
Valid Options (default value) | Description |
---|---|
- pipename ("smartinspect") | Specifies the named pipe for sending log packets to the SmartInspect Console. This value must match the pipe name in the SmartInspect Console options. |
Sample Code
# package imports.
from smartinspectpython.siauto import *
# the following are sample SI Connections options for this protocol.
# log messages to SI Console using all default options (pipename=smartinspect).
SIAuto.Si.Connections = "pipe()"
# log messages to SI Console using pipe name "sipipe", with asyncronous send enabled.
SIAuto.Si.Connections = "pipe(pipename=sipipe,reconnect=true,reconnect.interval=10s,async.enabled=true)"