DataIn Event Behavior with EOL in TCPClient and TCPServer
In some cases, the DataIn event may not fire as expected when working with TCPClient or TCPServer due to how these components buffer incoming data. The DataIn event is triggered based on specific buffering conditions, allowing you to control when the event fires.
If the EOL property is not set, the DataIn event fires immediately whenever data is received; however, when the EOL property is set, incoming data is buffered and the DataIn event fires only in the following cases:
- The EOL delimiter is not found, but the buffered data reaches the MaxLineLength
- The EOL delimiter is found in the received data
- The connection is closed or interrupted while data remains buffered
By configuring the EOL and MaxLineLength properties, you can control how and when the DataIn event is triggered, enabling more precise handling of incoming TCP/IP data streams.
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.