matlab.net.http.io.ContentProvider.start - Start data transfer from ContentProvider - MATLAB (original) (raw)
Main Content
Class: matlab.net.http.io.ContentProvider
Namespace: matlab.net.http.io
Start data transfer from ContentProvider
Description
start([provider](#d126e829088))
is called each time MATLABĀ® is ready to start the transfer of a data stream by callinggetData
one or more times. Each time this is called, the provider is expected to reset so that the next call to getData
goes back to the beginning of the data stream.
Calling start
indicates that a connection to the server has been established and transfer of data is about to start. A subsequent call tostart
(without an intervening call to the complete
method) might indicate that the server requested a redirect to a different server, or requires another try with authentication credentials, and this could occur before, during, or after transmission of the data stream.
If your provider is restartable, reset your provider so that the next call togetData
returns to the beginning of the data stream, and ensure that the restartable
method returns true
.
If your provider is not restartable for the same message, but can be reused for a new message, ensure restartable
returns false.
Subclasses that override this method should always call their superclass method first. If the provider was already started and is not restartable, then start
throws an exception by default.
This method is the best place to implement costly initialization that is not needed until the server is ready to receive data, as opposed to the complete
method, which must do initialization necessary to create the message header. If the server cannot be contacted or rejects the message, then MATLAB does not call start
.
Input Arguments
Content provider, specified as amatlab.net.http.io.ContentProvider
object.
Version History
Introduced in R2018a