The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
mha_tcp.cpp File Reference

Classes

class  MHA_TCP::sock_init_t
 

Namespaces

 MHA_TCP
 A Namespace for TCP helper classes.
 

Macros

#define INVALID_SOCKET   (-1)
 
#define SOCKET_ERROR   (-1)
 
#define closesocket(fd)   (close((fd)))
 
#define ASYNC_CONNECT_STARTED   EINPROGRESS
 

Typedefs

typedef int SOCKET
 

Functions

std::string MHA_TCP::STRERROR (int err)
 Portable conversion from error number to error string. More...
 
std::string MHA_TCP::HSTRERROR (int err)
 Portable conversion from hostname error number to error string. More...
 
int MHA_TCP::N_ERRNO ()
 Portable access to last network error number. More...
 
int MHA_TCP::H_ERRNO ()
 Portable access to last hostname error number. More...
 
int MHA_TCP::G_ERRNO ()
 Portable access to last non-network error number. More...
 
static sockaddr_in host_port_to_sock_addr (const std::string &host, unsigned short port)
 
static SOCKET tcp_connect_to (const std::string &host, unsigned short port)
 
static SOCKET tcp_connect_to_with_timeout (const std::string &host, unsigned short port, Timeout_Watcher &timeout_watcher)
 
static void * thread_start_func (void *thread)
 

Variables

class MHA_TCP::sock_init_t MHA_TCP::sock_initializer
 

Macro Definition Documentation

◆ INVALID_SOCKET

#define INVALID_SOCKET   (-1)

◆ SOCKET_ERROR

#define SOCKET_ERROR   (-1)

◆ closesocket

#define closesocket (   fd)    (close((fd)))

◆ ASYNC_CONNECT_STARTED

#define ASYNC_CONNECT_STARTED   EINPROGRESS

Typedef Documentation

◆ SOCKET

typedef int SOCKET

Function Documentation

◆ host_port_to_sock_addr()

static sockaddr_in host_port_to_sock_addr ( const std::string &  host,
unsigned short  port 
)
static

◆ tcp_connect_to()

static SOCKET tcp_connect_to ( const std::string &  host,
unsigned short  port 
)
static

◆ tcp_connect_to_with_timeout()

static SOCKET tcp_connect_to_with_timeout ( const std::string &  host,
unsigned short  port,
Timeout_Watcher timeout_watcher 
)
static

◆ thread_start_func()

static void* thread_start_func ( void *  thread)
static