PipeClient Control
Properties Methods Events Configuration Settings Errors
The PipeClient control is a simple client for connecting and communicating over named pipes.
Syntax
PipeClient
Remarks
The PipeClient control 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 control 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 control will behave synchronously and wait for the operation to complete before returning control.
The control 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 control fails with an error.
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 control 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 control. |
Method List
The following is the full list of the methods of the control 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 control 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 control is ready to send data. |
Configuration Settings
The following is a list of configuration settings for the control 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. |
CodePage | The system code page used for Unicode to Multibyte translations. |
UseInternalSecurityAPI | Tells the control whether or not to use the system security libraries or an internal implementation. |