SecureTcp Object : Send Method |
Visual Basic |
---|
Public Function Send( _ ByRef Data As Variant, _ Optional ByVal LimitCount As Long = 0, _ Optional ByVal Urgent As Boolean = False _ ) As Long |
This method can only be used when the State property is tcpConnected (otherwise a ptNotConnected error is generated).
Data can be provided in two ways:
If LimitCount is specified and is greater than 0, then the number of bytes sent is limited to LimitCount. For example, if a Byte array of length 8192 contains only 100 bytes that you wish to send, then a LimitCount of 100 can be used to override the default behavior, which would be to send the entire 8192 bytes (the length of the array).
This method supports blocking and non-blocking operation, depending on the value of the Timeout property. The Blocked property may be checked to verify the control is not busy executing another method. If the Timeout property is positive, this method will block until the system accepts the data for sending (SendBufferCount decrements to 0) or the timeout period expires.
Set the Urgent parameter to True to send Out-of-band data. This is not typically used, but some servers rely on it. PowerTCP uses the SO_OOBINLINE socket option to always receive out-of-band data "in-line".
You can also send binary data types and structures. Use the Fill method to receive binary data types and structures.
This method may generate the following error code (refer to ErrorConstants for a complete list of error codes):