proxygen
|
#include <AsyncTransport.h>
Public Types | |
using | UniquePtr = std::unique_ptr< AsyncTransportWrapper, Destructor > |
using | ReadCallback = AsyncReader::ReadCallback |
using | WriteCallback = AsyncWriter::WriteCallback |
Public Types inherited from folly::AsyncTransport | |
typedef std::unique_ptr< AsyncTransport, Destructor > | UniquePtr |
Public Member Functions | |
void | setReadCB (ReadCallback *callback) override=0 |
ReadCallback * | getReadCallback () const override=0 |
void | write (WriteCallback *callback, const void *buf, size_t bytes, WriteFlags flags=WriteFlags::NONE) override=0 |
void | writev (WriteCallback *callback, const iovec *vec, size_t count, WriteFlags flags=WriteFlags::NONE) override=0 |
void | writeChain (WriteCallback *callback, std::unique_ptr< IOBuf > &&buf, WriteFlags flags=WriteFlags::NONE) override=0 |
virtual const AsyncTransportWrapper * | getWrappedTransport () const |
template<class T > | |
const T * | getUnderlyingTransport () const |
template<class T > | |
T * | getUnderlyingTransport () |
Public Member Functions inherited from folly::AsyncTransport | |
virtual void | close ()=0 |
virtual void | closeNow ()=0 |
virtual void | closeWithReset () |
virtual void | shutdownWrite ()=0 |
virtual void | shutdownWriteNow ()=0 |
virtual bool | good () const =0 |
virtual bool | readable () const =0 |
virtual bool | writable () const |
virtual bool | isPending () const |
virtual bool | connecting () const =0 |
virtual bool | error () const =0 |
virtual void | attachEventBase (EventBase *eventBase)=0 |
virtual void | detachEventBase ()=0 |
virtual bool | isDetachable () const =0 |
virtual void | setSendTimeout (uint32_t milliseconds)=0 |
virtual uint32_t | getSendTimeout () const =0 |
virtual void | getLocalAddress (SocketAddress *address) const =0 |
SocketAddress | getLocalAddress () const |
void | getAddress (SocketAddress *address) const override |
virtual void | getPeerAddress (SocketAddress *address) const =0 |
SocketAddress | getPeerAddress () const |
virtual ssl::X509UniquePtr | getPeerCert () const |
virtual const X509 * | getSelfCert () const |
virtual const AsyncTransportCertificate * | getPeerCertificate () const |
virtual const AsyncTransportCertificate * | getSelfCertificate () const |
virtual std::string | getApplicationProtocol () const noexcept |
virtual std::string | getSecurityProtocol () const |
virtual bool | isEorTrackingEnabled () const =0 |
virtual void | setEorTracking (bool track)=0 |
virtual size_t | getAppBytesWritten () const =0 |
virtual size_t | getRawBytesWritten () const =0 |
virtual size_t | getAppBytesReceived () const =0 |
virtual size_t | getRawBytesReceived () const =0 |
virtual bool | isReplaySafe () const |
virtual void | setReplaySafetyCallback (ReplaySafetyCallback *callback) |
Public Member Functions inherited from folly::DelayedDestruction | |
virtual void | destroy () |
bool | getDestroyPending () const |
Public Member Functions inherited from folly::DelayedDestructionBase | |
virtual | ~DelayedDestructionBase ()=default |
Public Member Functions inherited from folly::AsyncSocketBase | |
virtual EventBase * | getEventBase () const =0 |
virtual | ~AsyncSocketBase ()=default |
Additional Inherited Members | |
Protected Member Functions inherited from folly::AsyncTransport | |
~AsyncTransport () override=default | |
Protected Member Functions inherited from folly::DelayedDestruction | |
~DelayedDestruction () override=default | |
DelayedDestruction () | |
Protected Member Functions inherited from folly::DelayedDestructionBase | |
DelayedDestructionBase () | |
uint32_t | getDestructorGuardCount () const |
Protected Member Functions inherited from folly::AsyncReader | |
virtual | ~AsyncReader ()=default |
Protected Member Functions inherited from folly::AsyncWriter | |
virtual | ~AsyncWriter ()=default |
Definition at line 697 of file AsyncTransport.h.
Definition at line 705 of file AsyncTransport.h.
using folly::AsyncTransportWrapper::UniquePtr = std::unique_ptr<AsyncTransportWrapper, Destructor> |
Definition at line 701 of file AsyncTransport.h.
Definition at line 706 of file AsyncTransport.h.
|
overridepure virtual |
|
inline |
In many cases when we need to set socket properties or otherwise access the underlying transport from a wrapped transport. This method allows access to the derived classes of the underlying transport.
Definition at line 738 of file AsyncTransport.h.
References current, getWrappedTransport(), and folly::T.
Referenced by proxygen::HTTPSession::connCloseByRemote(), proxygen::HTTPSession::getCertAuthSettingVal(), proxygen::HTTPSession::onCertificate(), proxygen::HTTPSession::onCertificateRequest(), folly::TEST(), and proxygen::HTTPSession::verifyCertAuthSetting().
|
inline |
Definition at line 751 of file AsyncTransport.h.
References folly::T.
|
inlinevirtual |
The transport wrapper may wrap another transport. This returns the transport that is wrapped. It returns nullptr if there is no wrapped transport.
Reimplemented in folly::DecoratedAsyncTransportWrapper< T >, and folly::DecoratedAsyncTransportWrapper< folly::AsyncTransportWrapper >.
Definition at line 728 of file AsyncTransport.h.
Referenced by getUnderlyingTransport(), and folly::test::MockAsyncTransport::writeChain().
|
overridepure virtual |
Implements folly::AsyncReader.
Implemented in folly::AsyncSSLSocket, folly::AsyncSocket, fizz::AsyncFizzBase, fizz::test::LocalTransport, folly::DecoratedAsyncTransportWrapper< T >, and folly::DecoratedAsyncTransportWrapper< folly::AsyncTransportWrapper >.
Referenced by proxygen::PassThroughTransportFilter::PassThroughTransportFilter().
|
overridepure virtual |
If you supply a non-null WriteCallback, exactly one of writeSuccess() or writeErr() will be invoked when the write completes. If you supply the same WriteCallback object for multiple write() calls, it will be invoked exactly once per call. The only way to cancel outstanding write requests is to close the socket (e.g., with closeNow() or shutdownWriteNow()). When closing the socket this way, writeErr() will still be invoked once for each outstanding write operation.
Implements folly::AsyncWriter.
Implemented in folly::AsyncSocket, fizz::test::LocalTransport, folly::DecoratedAsyncTransportWrapper< T >, folly::DecoratedAsyncTransportWrapper< folly::AsyncTransportWrapper >, folly::WriteChainAsyncTransportWrapper< T >, and folly::WriteChainAsyncTransportWrapper< folly::AsyncTransportWrapper >.
|
overridepure virtual |
If you supply a non-null WriteCallback, exactly one of writeSuccess() or writeErr() will be invoked when the write completes. If you supply the same WriteCallback object for multiple write() calls, it will be invoked exactly once per call. The only way to cancel outstanding write requests is to close the socket (e.g., with closeNow() or shutdownWriteNow()). When closing the socket this way, writeErr() will still be invoked once for each outstanding write operation.
Implements folly::AsyncWriter.
Implemented in folly::AsyncSocket, fizz::test::LocalTransport, fizz::AsyncFizzBase, folly::WriteChainAsyncTransportWrapper< T >, folly::WriteChainAsyncTransportWrapper< folly::AsyncTransportWrapper >, folly::DecoratedAsyncTransportWrapper< T >, folly::DecoratedAsyncTransportWrapper< folly::AsyncTransportWrapper >, folly::test::TestWriteChainAsyncTransportWrapper, and folly::test::MockAsyncTransport.
|
overridepure virtual |
If you supply a non-null WriteCallback, exactly one of writeSuccess() or writeErr() will be invoked when the write completes. If you supply the same WriteCallback object for multiple write() calls, it will be invoked exactly once per call. The only way to cancel outstanding write requests is to close the socket (e.g., with closeNow() or shutdownWriteNow()). When closing the socket this way, writeErr() will still be invoked once for each outstanding write operation.
Implements folly::AsyncWriter.
Implemented in folly::AsyncSocket, fizz::test::LocalTransport, folly::DecoratedAsyncTransportWrapper< T >, folly::DecoratedAsyncTransportWrapper< folly::AsyncTransportWrapper >, folly::WriteChainAsyncTransportWrapper< T >, and folly::WriteChainAsyncTransportWrapper< folly::AsyncTransportWrapper >.