Dart Telnet Control
Send Method
String, Byte, or Byte array. Data to be sent.
Number of bytes to send (limits a String or Byte array to LimitCount bytes).
Description
Send data after a connection is established. The Send event fires when Data is accepted by the system buffers. The SendBufferCount property indicates the number of bytes that have been submitted but have not yet been accepted by the system buffers.
Syntax
Visual Basic
Public Function Send( _
   ByRef Data As Variant, _
   Optional ByVal LimitCount As Long = 0 _
) As Long
Parameters
Data
String, Byte, or Byte array. Data to be sent.
LimitCount
Number of bytes to send (limits a String or Byte array to LimitCount bytes).
Return Value
Number of bytes submitted.
Remarks

You can use this method only 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 the user wants 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 can be invoked as blocking or non-blocking, depending on the value of the Timeout property. When performing blocked method calls, the Blocked property may be checked to verify the control is not busy executing another method. If the Timeout property is positive, this method blocks until the system accepts the data for sending (the SendBufferCount property decrements to 0) or the timeout period expires.

Any IAC character (ASCII 255) is doubled up according to the protocol specification. Any CR character (ASCII 13) not followed by a LF character (ASCII 10) has a NULL inserted after it according to the protocol specification. The reciprocal operation is applied to received data. The user should use CR/LF (ASCII 13 and ASCII 10) to terminate each line.

Error Codes
The Send method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):

 

Example
See Also

Telnet Object  | Telnet Members


Documentation Version 1.9.3.0
© 2020 Dart Communications. All Rights Reserved.
Send comments on this topic