|
| | BasicAsyncRawSocket (Proactor &proactor=ProactorThread::proactor()) |
| | create the socket instance.
|
| |
| | BasicAsyncRawSocket (Socket &&sock, Proactor &proactor=ProactorThread::proactor()) |
| | create the socket instance adopting an already opened socket.
|
| |
| | BasicAsyncRawSocket (const BasicAsyncRawSocket &other)=delete |
| | copy constructor.
|
| |
| BasicAsyncRawSocket & | operator= (const BasicAsyncRawSocket &other)=delete |
| | copy assignment operator.
|
| |
| | BasicAsyncRawSocket (BasicAsyncRawSocket &&other) noexcept |
| | move constructor.
|
| |
| BasicAsyncRawSocket & | operator= (BasicAsyncRawSocket &&other) noexcept |
| | move assignment operator.
|
| |
| | ~BasicAsyncRawSocket () |
| | destroy the socket instance.
|
| |
| int | bind (const Endpoint &endpoint) noexcept |
| | assign the specified endpoint to the socket.
|
| |
| int | bindToDevice (const std::string &device) noexcept |
| | assign the specified device to the socket.
|
| |
| int | canRead () const noexcept |
| | get the number of readable bytes.
|
| |
| ssize_t | asyncRead (char *data, size_t maxSize, ReadHandler handler, bool flush=true, bool link=false) noexcept |
| | start an asynchronous read.
|
| |
| ssize_t | asyncReadMulti (uint16_t group, ReadHandler handler, bool flush=true) noexcept |
| | start an asynchronous multishot read, staying armed until cancelled or failed.
|
| |
| ssize_t | asyncWrite (const char *data, size_t size, WriteHandler handler, bool flush=true, bool link=false) noexcept |
| | start an asynchronous write.
|
| |
| int | cancelConnect () noexcept |
| | cancel the connect operation in flight, if any.
|
| |
| int | setOption (Option option, int value) noexcept |
| | set the given option to the given value.
|
| |
| BasicAsyncSocket & | operator= (const BasicAsyncSocket &other)=delete |
| | copy assignment operator.
|
| |
| BasicAsyncSocket & | operator= (BasicAsyncSocket &&other) noexcept |
| | move assignment operator.
|
| |
| | ~BasicAsyncSocket () |
| | destroy the socket instance.
|
| |
| int | open (const Protocol &protocol=Protocol()) noexcept |
| | open socket using the given protocol.
|
| |
| void | close () noexcept |
| | close the socket, cancelling the operations in flight.
|
| |
| int | registerBufferRing (uint16_t group, LocalMem::Allocator< Count, Size > &arena) |
| | register a provided buffer ring on the proactor driving this socket.
|
| |
| int | unregisterBufferRing (uint16_t group) |
| | unregister a provided buffer ring from the proactor driving this socket.
|
| |
| ssize_t | asyncWait (bool wantRead, bool wantWrite, WaitHandler handler, bool flush=true) noexcept |
| | start an asynchronous wait for the socket to become ready in one direction.
|
| |
| ssize_t | asyncWaitMulti (bool wantRead, bool wantWrite, WaitHandler handler, bool flush=true) noexcept |
| | start an asynchronous multishot wait, staying armed until cancelled or failed.
|
| |
| int | cancel (size_t index) noexcept |
| | cancel the operation stored at the given index, if in flight.
|
| |
| Endpoint | localEndpoint () const noexcept |
| | determine the local endpoint associated with this socket.
|
| |
| bool | opened () const noexcept |
| | check if the socket is opened.
|
| |
| int | family () const noexcept |
| | get address family.
|
| |
| int | type () const noexcept |
| | get the protocol communication semantic.
|
| |
| int | protocol () const noexcept |
| | get socket protocol.
|
| |
| int | handle () const noexcept |
| | get socket native handle.
|
| |
Public Member Functions inherited from join::CompletionHandler |
| | CompletionHandler ()=default |
| | create instance.
|
| |
| | CompletionHandler (const CompletionHandler &other)=default |
| | copy constructor.
|
| |
| CompletionHandler & | operator= (const CompletionHandler &other)=default |
| | copy assignment operator.
|
| |
| | CompletionHandler (CompletionHandler &&other)=default |
| | move constructor.
|
| |
| CompletionHandler & | operator= (CompletionHandler &&other)=default |
| | move assignment operator.
|
| |
| virtual | ~CompletionHandler ()=default |
| | destroy instance.
|
| |
|
| void | dispatch (IoOperation &op, const std::error_code &code, size_t size) noexcept override |
| | invoke the completion handler of the given operation, then release it.
|
| |
| void | completeConnect (AsyncWrite *connect, const std::error_code &code) noexcept |
| | invoke the connect completion handler.
|
| |
| void | completeRead (AsyncRead *read, const std::error_code &code, size_t size) noexcept |
| | invoke the read completion handler.
|
| |
| void | completeWrite (AsyncWrite *write, const std::error_code &code, size_t size) noexcept |
| | invoke the write completion handler.
|
| |
| AsyncRead * | allocateRead () noexcept |
| | allocate a read operation in the arena.
|
| |
| AsyncWrite * | allocateWrite () noexcept |
| | allocate a write operation in the arena.
|
| |
| | BasicAsyncSocket (BasicProactor &proactor=ProactorThread::proactor()) |
| | create the socket instance.
|
| |
| | BasicAsyncSocket (Socket &&sock, BasicProactor &proactor=ProactorThread::proactor()) |
| | create the socket instance adopting an already opened socket.
|
| |
| | BasicAsyncSocket (const BasicAsyncSocket &other)=delete |
| | copy constructor.
|
| |
| | BasicAsyncSocket (BasicAsyncSocket &&other) noexcept |
| | move constructor.
|
| |
| void | onComplete (IoOperation &op, int result) override |
| | method called when an operation completes.
|
| |
| void | onCancel (IoOperation &op, int result) override |
| | method called when an operation is cancelled.
|
| |
| void | completeWait (AsyncWait *wait, const std::error_code &code, size_t revents) noexcept |
| | invoke the wait completion handler.
|
| |
| Op * | allocateOp () noexcept |
| | allocate an operation in the arena.
|
| |
| void | releaseOp (Op *operation) noexcept |
| | return an operation to the arena.
|
| |
| void | suspendAll () noexcept |
| | suspend every operation in flight.
|
| |
| void | resumeAll () noexcept |
| | resume every suspended operation, redirecting it to this handler.
|
| |
| void | cancelAll () noexcept |
| | cancel every operation in flight.
|
| |
| bool | pendingAny () const noexcept |
| | check if at least one operation is in flight or completing.
|
| |
| int | cancelOp (IoOperation *op) noexcept |
| | cancel the given operation, if in flight.
|
| |
| bool | inFlight (const IoOperation &op) const noexcept |
| | check if an operation is in flight.
|
| |
| bool | pending (const IoOperation &op) const noexcept |
| | check if an operation is in flight or completing.
|
| |
Protected Member Functions inherited from join::CompletionHandler |
template<class Protocol, class
Proactor = BasicProactor, size_t OpCount = 16>
class join::BasicAsyncRawSocket< Protocol, Proactor, OpCount >
asynchronous raw socket class.