apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

MethodFd Struct Referenceabstract

Small representation of a file descriptor for network traffic. More...

#include <connect.h>

Inheritance diagram for MethodFd:
[legend]

Public Member Functions

virtual int Fd ()=0
 Returns -1 for unusable, or an fd to select() on otherwise. More...
 
virtual ssize_t Read (void *buf, size_t count)=0
 Should behave like read(2) More...
 
virtual ssize_t Write (void *buf, size_t count)=0
 Should behave like write(2) More...
 
virtual int Close ()=0
 Closes the file descriptor. Can be called multiple times. More...
 
virtual ~MethodFd ()
 Destructor. More...
 
virtual bool HasPending ()
 If there is pending data. More...
 

Static Public Member Functions

static std::unique_ptr< MethodFdFromFd (int iFd)
 Construct a MethodFd from a UNIX file descriptor. More...
 

Detailed Description

Small representation of a file descriptor for network traffic.

This provides support for TLS, SOCKS, and HTTP CONNECT proxies.

Definition at line 23 of file connect.h.

Constructor & Destructor Documentation

◆ ~MethodFd()

virtual ~MethodFd ( )
inlinevirtual

Destructor.

Definition at line 34 of file connect.h.

Member Function Documentation

◆ Close()

virtual int Close ( )
pure virtual

Closes the file descriptor. Can be called multiple times.

Implemented in FdFd, TlsFd, and HttpConnectFd.

◆ Fd()

virtual int Fd ( )
pure virtual

Returns -1 for unusable, or an fd to select() on otherwise.

Implemented in FdFd, TlsFd, and HttpConnectFd.

◆ FromFd()

std::unique_ptr< MethodFd > FromFd ( int  iFd)
static

Construct a MethodFd from a UNIX file descriptor.

Definition at line 106 of file connect.cc.

References FdFd::fd.

Referenced by HttpServerState::Flush(), HttpServerState::HttpServerState(), and UnwrapTLS().

◆ HasPending()

bool HasPending ( )
virtual

If there is pending data.

Reimplemented in TlsFd, and HttpConnectFd.

Definition at line 102 of file connect.cc.

◆ Read()

virtual ssize_t Read ( void *  buf,
size_t  count 
)
pure virtual

Should behave like read(2)

Implemented in FdFd, TlsFd, and HttpConnectFd.

◆ Write()

virtual ssize_t Write ( void *  buf,
size_t  count 
)
pure virtual

Should behave like write(2)

Implemented in FdFd, TlsFd, and HttpConnectFd.


The documentation for this struct was generated from the following files: