nw::io::IOStream::WriteAsync Member Function

Syntax

virtual bool WriteAsync(
     const void * buf,
     u32 length,
     IOStreamCallback callback,
     void*           arg
);

Arguments

Name Description
in buf Pointer to the buffer where data to be written is stored. The alignment of this data must match the alignment obtained using the GetBufferAlign function.
in length Data size to be written. The alignment of this data must match the alignment obtained using the GetSizeAlign function.
in callback Registers the callback function to be used when asynchronous processing has finished. If this is NULL, no callback is invoked.
in arg Registers parameters returned by the callback function as arguments when asynchronous processing has completed.

Return Values

Returns TRUE if the command was executed normally.
Returns FALSE if the command was not issued.
If the command could not be issued, no callback is invoked.

Description

Writes data to the stream (asynchronous process).

It fails on ASSERT when false is returned by both the nw::io::IOStream::CanWrite function and the nw::io::IOStream::CanAsyncfunction. During asynchronous processing the nw::io::IOStream::IsBusy function returns true, and during that time other asynchronous processes cannot be called.
When processing completes, the registered callback is invoked provided the callback argument is not NULL.
It is also possible to wait for asynchronous processing to end using the nw::io::IOStream::WaitAsync function.

See Also

nw::io::IOStream::Write
nw::io::IOStream::IsBusy
nw::io::IOStream::WaitAsync
nw::io::IOStream::CanWrite
nw::io::IOStream::CanAsync
nw::io::IOStream::GetBufferAlign
nw::io::IOStream::GetSizeAlign

Revision History

2009/10/20
Initial version.

CONFIDENTIAL