PipeClient Component
Properties Methods Events Configuration Settings Errors
The PipeClient component is a simple client for connecting and communicating over named pipes.
Syntax
TiipPipeClient
Remarks
The PipeClient component is used to connect to an existing pipe server. After connecting the transfer of data is handled very similarly to socket communication.
To begin, first set PipeName to the name of the pipe to which the connection will be made. Call Connect or set Connected to True to establish the connection. The Connected event will fire when the connection is complete.
After connecting set DataToSend, or call Send or SendFile to send data. Incoming data is received through the DataIn event.
To disconnect call Disconnect or set Connected to False.
Synchronous and Asynchronous Operation
If the Timeout property is set to 0, the component will behave asynchronously and all operations return immediately, potentially failing with an error if they can't be completed immediately.
If Timeout is set to a positive value, the component will behave synchronously and wait for the operation to complete before returning control.
The component will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.
If Timeout expires, and the operation is not yet complete, the component raises an exception.
Please note that by default, all timeouts are inactivity timeouts, i.e. the timeout period is extended by Timeout seconds when any amount of data is successfully sent or received.
The default value for the Timeout property is 60 seconds.
Property List
The following is the full list of the properties of the component with short descriptions. Click on the links for further details.
AcceptData | Enables or disables data reception (the DataIn event). |
BytesSent | The number of bytes actually sent after an assignment to DataToSend . |
Connected | Triggers a connection or disconnection. |
DataToSend | A string of data to be sent over the connected pipe. |
EOL | Used to break the incoming data stream into chunks separated by EOL. |
PipeName | The name of the pipe. |
RecordLength | The length of received data records. |
SingleLineMode | Special mode for line-oriented protocols. |
Timeout | A timeout for the component. |
Method List
The following is the full list of the methods of the component with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting. |
Connect | Connects to a named pipe. |
Disconnect | Disconnects from the named pipe. |
DoEvents | Processes events from the internal message queue. |
GetLine | Gets a line of text from the server. |
Interrupt | Interrupts the current action. |
Send | Sends data over the connected pipe. |
SendFile | Sends the file over the connected pipe. |
SendLine | Sends a string followed by a newline. |
Event List
The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.
Connected | Fired immediately after a connection completes. |
DataIn | Fired when data (complete lines) comes in. |
Disconnected | Fired when a connection is closed. |
Error | Information about errors during data delivery. |
ReadyToSend | Fired when the component is ready to send data. |
Configuration Settings
The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
InBufferSize | The size in bytes of the output buffer. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
OutBufferSize | The size in bytes of the input buffer. |
PipeDirection | Determines the direction data flows. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
UseInternalSecurityAPI | Tells the component whether or not to use the system security libraries or an internal implementation. |