Dart Telnet Control
Send Event
Description
Fires when the system accepts data for sending.
Syntax
Visual Basic
Public Event Send()
Remarks

WARNING  Timeout must be 0 when calling methods from within an event. Failure to observe this rule may cause reentrancy problems and unpredictable results.

Each time the Send method is used, data is stored in a buffer and submitted to the system for sending. Between the time the Send method is called and the Send event fires, SendBufferCount is a positive value that indicates how many bytes are currently in this queue. This event fires each time SendBufferCount decreases because the system has accepted more data.

Use this method for outbound spooling tasks, such as sending a file over the network. Each time the Send event fires, read the next file segment from disk and send it.

Example
Private Sub Tcp1_Send()
On Error GoTo OnError ' use intrinsic error handling
	' read from file that is open and send that string
	' this event will fire again later when we can send more
	Dim Count As Long
	' compute the number of bytes left in the file
	gSendTransfer = LOF(2) - Loc(2)
	' limit the number of bytes to the specified buffers size
	If gSendTransfer > CLng(Text1.Text) Then gSendTransfer = Text1.Text
	If gSendTransfer > 0 Then
	' save the number of bytes sent and send the data
	Count = Tcp1.Send(Input$(gFile, #2))
	' put up the total count read so far
	Label1.Caption = Str(Val(Label2.Caption) + Count)
	End If
	Exit Sub
OnError: ' Any error jumps here
	Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description
End Sub
See Also

Telnet Object  | Telnet Members


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