PipeConnection Type

A currently connected client.

Remarks

This type describes the connection of a client which is currently connected to the component. The connection may be managed using the different fields of this type.

Fields

AcceptData
Boolean

Setting this field to False, temporarily disables data reception (and the DataIn event) on the connection. Setting this to True, re-enables data reception.

BytesSent
Integer

This field shows how many bytes were sent after the last assignment to DataToSend. Please check DataToSend for more information.

Note that this field will always return 0 when the component is operating in synchronous mode (that is, the Timeout property is set to a positive value.)

Connected
Boolean

This field is used to disconnect individual connections and/or show their status.

The Connected field may be set to false to close the connection.

Connected also shows the status of a particular connection (connected/disconnected).

ConnectionId
String

This field contains an identifier generated by the component to identify each connection. This identifier is unique to this connection.

DataToSend
String

This field contains a string of data to be sent to the remote host. Write-only property.

Assigning a string to the DataToSend makes the component send the string to the remote host. The Send method provides similar functionality.

When Timeout is set to 0 and SSLEnabled is set to False the component will behave asynchronously. If you are sending data to the remote host faster than it can process it, or faster than the network's bandwidth allows, the outgoing queue might fill up. When this happens, DataToSend fails with exception 10035: "[10035] Operation would block" (WSAEWOULDBLOCK). You can check this error, and then try to send the data again. The BytesSent property shows how many bytes were sent (if any). If 0 bytes were sent, then you can wait for the ReadyToSend event before attempting to send data again. (However, please note that ReadyToSend is not fired when part of the data is successfully sent).

When SSLEnabled is True or Timeout is set to a positive value the component behaves synchronously.

DataToSendB
Byte[]

This field contains a string of data to be sent to the remote host. Write-only property.

Assigning a string to the DataToSend makes the component send the string to the remote host. The Send method provides similar functionality.

When Timeout is set to 0 and SSLEnabled is set to False the component will behave asynchronously. If you are sending data to the remote host faster than it can process it, or faster than the network's bandwidth allows, the outgoing queue might fill up. When this happens, DataToSend fails with exception 10035: "[10035] Operation would block" (WSAEWOULDBLOCK). You can check this error, and then try to send the data again. The BytesSent property shows how many bytes were sent (if any). If 0 bytes were sent, then you can wait for the ReadyToSend event before attempting to send data again. (However, please note that ReadyToSend is not fired when part of the data is successfully sent).

When SSLEnabled is True or Timeout is set to a positive value the component behaves synchronously.

EOL
String

The EOL field is used to define boundaries in the input stream using the value of the field.

The EOL field is especially useful with ASCII files. Setting it to CRLF ("\r\n") enables splitting of the incoming ASCII text stream into lines. In this case, one event is fired for each line received (as well as in packet boundaries). The CRLF ("\r\n") . bytes are discarded.

The EOL field is a binary string. In particular, this means that it can be more than one byte long, and it can contain NULL bytes.

EOLB
Byte[]

The EOL field is used to define boundaries in the input stream using the value of the field.

The EOL field is especially useful with ASCII files. Setting it to CRLF ("\r\n") enables splitting of the incoming ASCII text stream into lines. In this case, one event is fired for each line received (as well as in packet boundaries). The CRLF ("\r\n") . bytes are discarded.

The EOL field is a binary string. In particular, this means that it can be more than one byte long, and it can contain NULL bytes.

MaxLineLength
Integer

This field is the size of an internal buffer which holds received data while waiting for an EOL string.

If an EOL string is found in the input stream before MaxLineLength bytes are received, the DataIn event is fired with the EOL parameter set to True, and the buffer is reset.

If no EOL is found, and MaxLineLength bytes are accumulated in the buffer, the DataIn event is fired with the EOL parameter set to False, and the buffer is reset.

The minimum value for MaxLineLength is 256 bytes. The default value is 2048 bytes.

SingleLineMode
Boolean

This field shows the special mode for line-oriented protocols. When SingleLineMode is True, the component treats the incoming data stream as lines separated by CRLF, CR, or LF. The EOL property is ignored.

Timeout
Integer

This field specifies a timeout for the component.

This field defines the timeout when sending data. When SSLEnabled is False a value of 0 means data will be sent asynchronously and a positive value means data is sent synchronously. When SSLEnabled is True all data is sent synchronously regardless of the Timeout value. Please see the notes below for details.

Plaintext

If the Timeout field is set to 0, all operations return immediately, potentially failing with a WOULDBLOCK error if data cannot be sent immediately.

If Timeout is set to a positive value, data is sent in a blocking manner and the component will wait for the operation to complete before returning control. The component will handle any potential WOULDBLOCK errors internally and automatically retry the operation for a maximum of Timeout seconds.

SSL

If the Timeout field is set to 0, all operations will run uninterrupted until successful completion or an error condition is encountered.

If Timeout is set to a positive value, the component will wait for the operation to complete before returning control.

Additional Notes

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 throws 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 field is 0 (asynchronous for plaintext, synchronous for SSL).

UploadStream
System.IO.Stream

Setting this field uploads the data in the specified stream to the current connection. The component will automatically close this stream if CloseStreamAfterTransfer is true (default).

Constructors

public PipeConnection();
Public PipeConnection()

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IPC 2020 .NET Edition - Version 20.0 [Build 8155]