proxygen
folly::AsyncUDPSocket::ReadCallback Class Referenceabstract

#include <AsyncUDPSocket.h>

Inheritance diagram for folly::AsyncUDPSocket::ReadCallback:
folly::AsyncUDPServerSocket

Public Member Functions

virtual void getReadBuffer (void **buf, size_t *len) noexcept=0
 
virtual void onDataAvailable (const folly::SocketAddress &client, size_t len, bool truncated) noexcept=0
 
virtual void onReadError (const AsyncSocketException &ex) noexcept=0
 
virtual void onReadClosed () noexcept=0
 
virtual ~ReadCallback ()=default
 

Detailed Description

Definition at line 40 of file AsyncUDPSocket.h.

Constructor & Destructor Documentation

virtual folly::AsyncUDPSocket::ReadCallback::~ReadCallback ( )
virtualdefault

Member Function Documentation

virtual void folly::AsyncUDPSocket::ReadCallback::getReadBuffer ( void **  buf,
size_t *  len 
)
pure virtualnoexcept

Invoked when the socket becomes readable and we want buffer to write to.

NOTE: From socket we will end up reading at most len bytes and if there were more bytes in datagram, we will end up dropping them.

Implemented in folly::AsyncUDPServerSocket.

Referenced by folly::AsyncUDPSocket::handleRead().

virtual void folly::AsyncUDPSocket::ReadCallback::onDataAvailable ( const folly::SocketAddress client,
size_t  len,
bool  truncated 
)
pure virtualnoexcept

Invoked when a new datagraom is available on the socket. len is the number of bytes read and truncated is true if we had to drop few bytes because of running out of buffer space.

Implemented in folly::AsyncUDPServerSocket.

Referenced by folly::AsyncUDPSocket::handleRead().

virtual void folly::AsyncUDPSocket::ReadCallback::onReadClosed ( )
pure virtualnoexcept

Invoked when socket is closed and a read callback is registered.

Implemented in folly::AsyncUDPServerSocket.

Referenced by folly::AsyncUDPSocket::close().

virtual void folly::AsyncUDPSocket::ReadCallback::onReadError ( const AsyncSocketException ex)
pure virtualnoexcept

Invoked when there is an error reading from the socket.

NOTE: Since UDP is connectionless, you can still read from the socket. But you have to re-register readCallback yourself after onReadError.

Implemented in folly::AsyncUDPServerSocket.

Referenced by folly::AsyncUDPSocket::handleRead(), and folly::AsyncUDPSocket::resumeRead().


The documentation for this class was generated from the following file: