System.Tether.AppProfile.TTetheringAppProfile.SendStream

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function SendStream(const AProfile: TTetheringProfileInfo; const Description: string; const AStream: TStream): Boolean;

C++

bool __fastcall SendStream(const System::Tether::Manager::TTetheringProfileInfo &AProfile, const System::UnicodeString Description, System::Classes::TStream* const AStream);

Properties

Type Visibility Source Unit Parent
function public
System.Tether.AppProfile.pas
System.Tether.AppProfile.hpp
System.Tether.AppProfile TTetheringAppProfile

Description

Sends the specified stream to the specified remote profile and returns True on success or False on failure.

This function receives the following parameters:

  • AProfile is the remote profile to receive the stream.
  • Description is a description of the contents of the stream.
  • AStream is the stream to be sent.

The remote profile receives the stream as a temporal resource. The remote profile receiving the stream may decide whether or not to accept the stream and, if accepted, read the stream.

SendStream returns False if there is a connection error during the transmission of the stream. It returns True otherwise. The stream is sent to the remote profile before the remote profile decides whether or not to accept the stream, so it might happen that the remote profile rejects the stream but SendStream returns True because the stream had been already successfully sent. There is no built-in mechanism to know whether or not the remote profile accepted the stream.

SendStream is a synchronous function. This function performs a request to the remote profile, and the function execution only finishes after there is a response from the remote profile. You might want to use a separate thread to run this function.

Exceptions

A call to SendStream may raise any of the following exceptions:

Exception Exception.Message Scenarios

ETetheringException

Cannot find profile <profile identifier>

Profile <profile identifier> is not connected.

  • AProfile is not connected.

No available connections to <profile identifier>

Cannot get a connection to profile <profile identifier>.

  • SendStream could not get a connection to AProfile.

Cannot connect to profile <profile identifier>

See Also