DebugServer2
Loading...
Searching...
No Matches
ds2::Host::Socket Class Reference
Inheritance diagram for ds2::Host::Socket:
Collaboration diagram for ds2::Host::Socket:

Public Member Functions

 Socket (SOCKET handle)
 
void close () override
 
bool valid () const
 
bool listening () const
 
bool connected () const override
 
bool listen (std::string const &address, std::string const &port)
 
std::unique_ptr< Socketaccept ()
 
bool connect (std::string const &host, std::string const &port)
 
std::string address () const
 
std::string port () const
 
std::string error () const
 
bool wait (int ms=-1) override
 
bool setNonBlocking ()
 
ssize_t send (void const *buffer, size_t length) override
 
ssize_t receive (void *buffer, size_t length) override
 
- Public Member Functions inherited from ds2::Host::Channel
virtual bool send (std::string const &buffer)
 
virtual bool receive (std::string &buffer)
 

Protected Types

enum class  State { Invalid , Listening , Connected }
 

Protected Member Functions

bool create (int af)
 
bool getSocketInfo (struct sockaddr_storage *ss) const
 

Protected Attributes

SOCKET _handle
 
State _state
 
int _lastError
 

Additional Inherited Members

- Static Public Member Functions inherited from ds2::make_unique_enabler< Socket >
static std::unique_ptr< Socket > make_protected_unique (Args... args)
 

Member Function Documentation

◆ close()

void ds2::Host::Socket::close ( )
overridevirtual

Implements ds2::Host::Channel.

◆ connected()

bool ds2::Host::Socket::connected ( ) const
inlineoverridevirtual

Implements ds2::Host::Channel.

◆ receive()

ssize_t ds2::Host::Socket::receive ( void * buffer,
size_t length )
overridevirtual

Implements ds2::Host::Channel.

◆ send()

ssize_t ds2::Host::Socket::send ( void const * buffer,
size_t length )
overridevirtual

Implements ds2::Host::Channel.

◆ wait()

bool ds2::Host::Socket::wait ( int ms = -1)
overridevirtual

Implements ds2::Host::Channel.


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