Starts a socket close operation. More...
#include <Async.h>
Public Types | |
using | CompletionData = AsyncCompletionData |
Completion data for AsyncSocketClose. More... | |
using | Result = AsyncResultOf< AsyncSocketClose, CompletionData > |
Callback result for AsyncSocketClose. More... | |
Public Types inherited from SC::AsyncRequest | |
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 &socketDescriptor) |
Starts a socket close operation. More... | |
Public Member Functions inherited from SC::AsyncRequest | |
void | setDebugName (const char *newDebugName) |
AsyncEventLoop * | getEventLoop () const |
Get the event loop associated with this AsyncRequest. More... | |
void | cacheInternalEventLoop (AsyncEventLoop &loop) |
Caches the event loop associated with this AsyncRequest. More... | |
AsyncRequest (Type type) | |
Constructs a free async request of given type. More... | |
Result | stop () |
Stops the async operation. More... | |
bool | isFree () const |
Public Attributes | |
int | code = 0 |
Return code of close socket operation. More... | |
Function< void(Result &)> | callback |
Callback called after fully closing the socket. More... | |
Public Attributes inherited from SC::AsyncRequest | |
AsyncRequest * | next = nullptr |
AsyncRequest * | prev = nullptr |
Friends | |
struct | AsyncEventLoop |
Additional Inherited Members | |
Protected Member Functions inherited from SC::AsyncRequest | |
Result | validateAsync () |
Result | queueSubmission (AsyncEventLoop &eventLoop) |
Result | queueSubmission (AsyncEventLoop &eventLoop, ThreadPool &threadPool, AsyncTask &task) |
Protected Attributes inherited from SC::AsyncRequest | |
AsyncEventLoop * | eventLoop = nullptr |
AsyncTask * | asyncTask = nullptr |
Starts a socket close operation.
Callback will be called when the socket has been fully closed.
Completion data for AsyncSocketClose.
Callback result for AsyncSocketClose.
SC::Result SC::AsyncSocketClose::start | ( | AsyncEventLoop & | eventLoop, |
const SocketDescriptor & | socketDescriptor | ||
) |
Starts a socket close operation.
Callback will be called when the socket has been fully closed.
eventLoop | The event loop where queuing this async request |
socketDescriptor | The socket to be closed |
Callback called after fully closing the socket.
int SC::AsyncSocketClose::code = 0 |
Return code of close socket operation.