Dart SecureTcp, SecureServer Controls
Fill Method
String or Byte array. Received bytes will be used to fill Data.
Description
Use this method when you know exactly how many bytes or characters you want from the TCP stream. Data is either filled to capacity or no data is returned. This method is useful for processing fixed-length records that can include binary structures.
Syntax
Visual Basic
Public Function Fill( _
   ByRef Data As Variant _
) As Long
Parameters
Data
String or Byte array. Received bytes will be used to fill Data.
Return Value
Returns the number of Unicode characters or bytes copied into Data.
Remarks

This method can only be used when the State is tcpConnected or tcpClosing (otherwise a ptNotConnected error is generated). When the State property is tcpClosing, the Receive, Fill, or Search methods can be used to flush the buffer and cause the State to change to tcpClosed.

Unlike the Receive and Search methods, the Fill method will not resize Data because its size indicates how many bytes should be read.

If Timeout is 0, this method immediately returns a Count of either 0 (no data was read) or the size of Data (Data was filled). If Timeout is greater than 0, this method attempts to completely fill Data with bytes or generate a ptTimeout error. If a ptTimeout error is generated, the session is aborted and all system resources are released.

If Data is a String and the default ANSI code page is not ASCII, multi-byte characters may convert to single Unicode characters. Blocked returns True while performing a blocking method (Timeout is greater than 0).

Out-of-band data is sent using the Send method with the Urgent parameter set to True. PowerTCP uses the SO_OOBINLINE socket option to always receive out-of-band data "in-line". In other words, all out-of-band data is received as normal data. It is up the user to correctly process this data.

Error Codes

This method may generate the following error code (refer to ErrorConstants for a complete list of error codes):

See Also

SecureTcp Object  | SecureTcp Members


PowerTCP SSL for ActiveX Documentation Version 2.2.1
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic