ESPHome  2024.12.2
Public Member Functions
esphome::socket::Socket Class Referenceabstract

#include <socket.h>

Inherited by esphome::socket::BSDSocketImpl, esphome::socket::LWIPRawImpl, and esphome::socket::LwIPSocketImpl.

Public Member Functions

 Socket ()=default
 
virtual ~Socket ()
 
 Socket (const Socket &)=delete
 
Socketoperator= (const Socket &)=delete
 
virtual std::unique_ptr< Socketaccept (struct sockaddr *addr, socklen_t *addrlen)=0
 
virtual int bind (const struct sockaddr *addr, socklen_t addrlen)=0
 
virtual int close ()=0
 
virtual int shutdown (int how)=0
 
virtual int getpeername (struct sockaddr *addr, socklen_t *addrlen)=0
 
virtual std::string getpeername ()=0
 
virtual int getsockname (struct sockaddr *addr, socklen_t *addrlen)=0
 
virtual std::string getsockname ()=0
 
virtual int getsockopt (int level, int optname, void *optval, socklen_t *optlen)=0
 
virtual int setsockopt (int level, int optname, const void *optval, socklen_t optlen)=0
 
virtual int listen (int backlog)=0
 
virtual ssize_t read (void *buf, size_t len)=0
 
virtual ssize_t recvfrom (void *buf, size_t len, sockaddr *addr, socklen_t *addr_len)=0
 
virtual ssize_t readv (const struct iovec *iov, int iovcnt)=0
 
virtual ssize_t write (const void *buf, size_t len)=0
 
virtual ssize_t writev (const struct iovec *iov, int iovcnt)=0
 
virtual ssize_t sendto (const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen)=0
 
virtual int setblocking (bool blocking)=0
 
virtual int loop ()
 

Detailed Description

Definition at line 12 of file socket.h.

Constructor & Destructor Documentation

◆ Socket() [1/2]

esphome::socket::Socket::Socket ( )
default

◆ ~Socket()

esphome::socket::Socket::~Socket ( )
virtual

Definition at line 11 of file socket.cpp.

◆ Socket() [2/2]

esphome::socket::Socket::Socket ( const Socket )
delete

Member Function Documentation

◆ accept()

virtual std::unique_ptr<Socket> esphome::socket::Socket::accept ( struct sockaddr addr,
socklen_t addrlen 
)
pure virtual

◆ bind()

virtual int esphome::socket::Socket::bind ( const struct sockaddr addr,
socklen_t  addrlen 
)
pure virtual

◆ close()

virtual int esphome::socket::Socket::close ( )
pure virtual

◆ getpeername() [1/2]

virtual int esphome::socket::Socket::getpeername ( struct sockaddr addr,
socklen_t addrlen 
)
pure virtual

◆ getpeername() [2/2]

virtual std::string esphome::socket::Socket::getpeername ( )
pure virtual

◆ getsockname() [1/2]

virtual int esphome::socket::Socket::getsockname ( struct sockaddr addr,
socklen_t addrlen 
)
pure virtual

◆ getsockname() [2/2]

virtual std::string esphome::socket::Socket::getsockname ( )
pure virtual

◆ getsockopt()

virtual int esphome::socket::Socket::getsockopt ( int  level,
int  optname,
void *  optval,
socklen_t optlen 
)
pure virtual

◆ listen()

virtual int esphome::socket::Socket::listen ( int  backlog)
pure virtual

◆ loop()

virtual int esphome::socket::Socket::loop ( )
inlinevirtual

Definition at line 44 of file socket.h.

◆ operator=()

Socket& esphome::socket::Socket::operator= ( const Socket )
delete

◆ read()

virtual ssize_t esphome::socket::Socket::read ( void *  buf,
size_t  len 
)
pure virtual

◆ readv()

virtual ssize_t esphome::socket::Socket::readv ( const struct iovec iov,
int  iovcnt 
)
pure virtual

◆ recvfrom()

virtual ssize_t esphome::socket::Socket::recvfrom ( void *  buf,
size_t  len,
sockaddr addr,
socklen_t addr_len 
)
pure virtual

◆ sendto()

virtual ssize_t esphome::socket::Socket::sendto ( const void *  buf,
size_t  len,
int  flags,
const struct sockaddr to,
socklen_t  tolen 
)
pure virtual

◆ setblocking()

virtual int esphome::socket::Socket::setblocking ( bool  blocking)
pure virtual

◆ setsockopt()

virtual int esphome::socket::Socket::setsockopt ( int  level,
int  optname,
const void *  optval,
socklen_t  optlen 
)
pure virtual

◆ shutdown()

virtual int esphome::socket::Socket::shutdown ( int  how)
pure virtual

◆ write()

virtual ssize_t esphome::socket::Socket::write ( const void *  buf,
size_t  len 
)
pure virtual

◆ writev()

virtual ssize_t esphome::socket::Socket::writev ( const struct iovec iov,
int  iovcnt 
)
pure virtual

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