DataToSend Property

A string of data to be sent to the remote host.

Syntax


public void setDataToSend(byte[] dataToSend);

Default Value

""

Remarks

Assigning a string to this property makes the class send the string to the remote host. The Send method provides similar functionality.

When Timeout is set to a positive value (default) the classwill behave synchronously. The class will not return control until all data has been delivered or an error is encountered.

When Timeout is set to 0 the class will behave asynchronously. The class will return control immediately. If data is being sent quickly and more than MaxOutgoingOutstandingCount packets are unacknowledged DataToSend will fail with a "Wouldblock" exception. When this exception occurs the BytesSent property holds the number of bytes that were sent (if any). Monitor the ReadyToSend event to determine when sending can resume. Resend the data which previously caused the exception after ReadyToSend fires.

This property is write-only and not available at design time.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks P2P 2020 Java Edition - Version 20.0 [Build 8235]