SecureTcp Object : Fill Method |
Visual Basic |
---|
Public Function Fill( _ ByRef Data As Variant _ ) As Long |
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.
This method may generate the following error code (refer to ErrorConstants for a complete list of error codes):