JBus
JoyBus communication server
jbus::net::Socket Class Reference

#include <Socket.hpp>

Public Types

enum  EResult { EResult::OK, EResult::Error, EResult::Busy }
 

Public Member Functions

 Socket (bool blocking)
 
 ~Socket ()
 
 Socket (const Socket &other)=delete
 
Socketoperator= (const Socket &other)=delete
 
 Socket (Socket &&other)
 
Socketoperator= (Socket &&other)
 
void setBlocking (bool blocking)
 
bool isOpen () const
 
bool openAndListen (const IPAddress &address, uint32_t port)
 
EResult accept (Socket &remoteSocketOut, sockaddr_in &fromAddress)
 
EResult accept (Socket &remoteSocketOut)
 
EResult accept (Socket &remoteSocketOut, std::string &fromHostname)
 
void close ()
 
EResult send (const void *buf, size_t len, size_t &transferred)
 
EResult send (const void *buf, size_t len)
 
EResult recv (void *buf, size_t len, size_t &transferred)
 
EResult recv (void *buf, size_t len)
 
 operator bool () const
 
SocketTp GetInternalSocket () const
 

Detailed Description

Server-oriented TCP socket class derived from SFML

Member Enumeration Documentation

Enumerator
OK 
Error 
Busy 

Constructor & Destructor Documentation

jbus::net::Socket::Socket ( bool  blocking)
inline
jbus::net::Socket::~Socket ( )
inline
jbus::net::Socket::Socket ( const Socket other)
delete
jbus::net::Socket::Socket ( Socket &&  other)
inline

Member Function Documentation

EResult jbus::net::Socket::accept ( Socket remoteSocketOut,
sockaddr_in &  fromAddress 
)
inline
EResult jbus::net::Socket::accept ( Socket remoteSocketOut)
inline
EResult jbus::net::Socket::accept ( Socket remoteSocketOut,
std::string &  fromHostname 
)
inline
void jbus::net::Socket::close ( )
inline
SocketTp jbus::net::Socket::GetInternalSocket ( ) const
inline
bool jbus::net::Socket::isOpen ( ) const
inline
bool jbus::net::Socket::openAndListen ( const IPAddress address,
uint32_t  port 
)
inline

Here is the call graph for this function:

jbus::net::Socket::operator bool ( ) const
inline
Socket& jbus::net::Socket::operator= ( const Socket other)
delete
Socket& jbus::net::Socket::operator= ( Socket &&  other)
inline
EResult jbus::net::Socket::recv ( void *  buf,
size_t  len,
size_t &  transferred 
)
inline
EResult jbus::net::Socket::recv ( void *  buf,
size_t  len 
)
inline
EResult jbus::net::Socket::send ( const void *  buf,
size_t  len,
size_t &  transferred 
)
inline
EResult jbus::net::Socket::send ( const void *  buf,
size_t  len 
)
inline
void jbus::net::Socket::setBlocking ( bool  blocking)
inline

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