Starts a socket close operation. More...
#include <Async.h>
Public Types | |
using | CompletionData = AsyncCompletionData |
using | Result = AsyncResultOf<AsyncSocketClose, CompletionData> |
![]() | |
enum class | Type : uint8_t { LoopTimeout , LoopWakeUp , LoopWork , ProcessExit , SocketAccept , SocketConnect , SocketSend , SocketReceive , SocketClose , FileRead , FileWrite , FileClose , FilePoll } |
Type of async request. More... | |
Public Member Functions | |
SC::Result | start (AsyncEventLoop &eventLoop, const SocketDescriptor &descriptor) |
Sets async request members and calls AsyncEventLoop::start. | |
Result | start (AsyncEventLoop &loop) |
Shortcut for AsyncEventLoop::start. | |
![]() | |
void | setDebugName (const char *newDebugName) |
AsyncEventLoop * | getEventLoop () const |
Get the event loop associated with this AsyncRequest. | |
void | cacheInternalEventLoop (AsyncEventLoop &loop) |
Caches the event loop associated with this AsyncRequest. | |
Result | setThreadPoolAndTask (ThreadPool &pool, AsyncTask &task) |
Sets the thread pool and task to use for this request. | |
void | resetThreadPoolAndTask () |
Resets anything previously set with setThreadPoolAndTask. | |
AsyncRequest (Type type) | |
Constructs a free async request of given type. | |
Result | stop (Function< void(AsyncResult &)> *afterStopped=nullptr) |
Ask to stop current async operation. | |
bool | isFree () const |
Returns true if this request is free. | |
bool | isCancelling () const |
Returns true if this request is being cancelled. | |
bool | isActive () const |
Returns true if this request is active or being reactivated. | |
Type | getType () const |
Returns request type. | |
Result | start (AsyncEventLoop &loop) |
Shortcut for AsyncEventLoop::start. | |
Public Attributes | |
int | code = 0 |
Return code of close socket operation. | |
Function< void(Result &)> | callback |
Callback called after fully closing the socket. | |
![]() | |
AsyncRequest * | next = nullptr |
AsyncRequest * | prev = nullptr |
Friends | |
struct | AsyncEventLoop |
Additional Inherited Members | |
![]() | |
Result | checkState () |
void | queueSubmission (AsyncEventLoop &eventLoop) |
![]() | |
AsyncEventLoop * | eventLoop = nullptr |
AsyncTask * | asyncTask = nullptr |
Starts a socket close operation.
Callback will be called when the socket has been fully closed.
SC::Result SC::AsyncSocketClose::start | ( | AsyncEventLoop & | eventLoop, |
const SocketDescriptor & | descriptor ) |
Sets async request members and calls AsyncEventLoop::start.
Result SC::AsyncRequest::start | ( | AsyncEventLoop & | loop | ) |
Shortcut for AsyncEventLoop::start.
Callback called after fully closing the socket.
int SC::AsyncSocketClose::code = 0 |
Return code of close socket operation.