Initiates an asynchronous read operation on the pipe.
Namespace:
MadWizard.WinUSBNet
Assembly:
WinUSBNet (in WinUSBNet.dll) Version: 2.0.0.0 (2.0.0.0)
Syntaxpublic IAsyncResult BeginRead(
byte[] buffer,
int offset,
int length,
AsyncCallback userCallback,
Object stateObject
)
Public Function BeginRead (
buffer As Byte(),
offset As Integer,
length As Integer,
userCallback As AsyncCallback,
stateObject As Object
) As IAsyncResult
public:
IAsyncResult^ BeginRead(
array<unsigned char>^ buffer,
int offset,
int length,
AsyncCallback^ userCallback,
Object^ stateObject
)
Parameters
- buffer
- Type: SystemByte
Buffer that will receive the data read from the pipe. - offset
- Type: SystemInt32
Byte offset within the buffer at which to begin writing the data received. - length
- Type: SystemInt32
Length of the data to transfer. - userCallback
- Type: SystemAsyncCallback
An optional asynchronous callback, to be called when the operation is complete. Can be null if no callback is required. - stateObject
- Type: SystemObject
A user-provided object that distinguishes this particular asynchronous operation. Can be null if not required.
Return Value
Type:
IAsyncResultAn
IAsyncResult object representing the asynchronous operation, which could still be pending.
RemarksThis method always completes immediately even if the operation is still pending. The
IAsyncResult object returned represents the operation
and must be passed to
EndRead(IAsyncResult) to retrieve the result of the operation. For every call to this method a matching call to
EndRead(IAsyncResult) must be made. When
userCallback specifies a callback function, this function will be called when the operation is completed. The optional
stateObject parameter can be used to pass user-defined information to this callback or the
IAsyncResult. The
IAsyncResult
also provides an event handle (
AsyncWaitHandle) that will be triggered when the operation is complete as well.
See Also