diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-09-11 22:15:35 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-09-11 22:24:33 +0200 |
commit | 9248c1d7976ba1c37e3df147a1eb3115fe72c8d0 (patch) | |
tree | e331a2fc4600fe80ca4e2b404d4379989a95d127 /src/InetAddress.h | |
parent | 8750493994d574001e466fef21ded86730359640 (diff) | |
download | dabmux-9248c1d7976ba1c37e3df147a1eb3115fe72c8d0.tar.gz dabmux-9248c1d7976ba1c37e3df147a1eb3115fe72c8d0.tar.bz2 dabmux-9248c1d7976ba1c37e3df147a1eb3115fe72c8d0.zip |
Drop SLIP, Refactor sockets, improve TCP output
Quite a large refactoring of the sockets, TCP and UDP, in order
to improve the ETI-over-TCP output. This can now accept several
simultaneous connections, and requires a throttle.
The SLIP input is gone. The UDP inputs are currently broken.
Diffstat (limited to 'src/InetAddress.h')
-rw-r--r-- | src/InetAddress.h | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/src/InetAddress.h b/src/InetAddress.h index 266b1fd..0ccc70b 100644 --- a/src/InetAddress.h +++ b/src/InetAddress.h @@ -1,6 +1,11 @@ /* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) + + Copyright (C) 2016 + Matthias P. Braendli, matthias.braendli@mpb.li + + http://www.opendigitalradio.org */ /* This file is part of ODR-DabMux. @@ -26,33 +31,17 @@ # include "config.h" #endif -// General libraries #include <stdlib.h> -// Linux librairies -#ifndef _WIN32 -// # include <sys/types.h> -# include <sys/socket.h> -# include <netinet/in.h> -# include <unistd.h> -# include <netdb.h> -# include <arpa/inet.h> -# include <pthread.h> -# define SOCKET int -# define INVALID_SOCKET -1 -# define closesocket ::close -// Windows librairies -#else -# include <winsock.h> -# ifdef _MSC_VER -# pragma comment(lib, "wsock32.lib") -# elif defined(__BORLANDC__) -# pragma(lib, "mswsock.lib") -# endif -# ifndef IN_MULTICAST -# define IN_MULTICAST(a) ((((unsigned long) (a)) & 0xf0000000) == 0xe0000000) -# endif -#endif -// General definitions +#include <sys/socket.h> +#include <netinet/in.h> +#include <unistd.h> +#include <netdb.h> +#include <arpa/inet.h> +#include <pthread.h> +#include <string> + +#define SOCKET int +#define INVALID_SOCKET -1 #define INVALID_PORT -1 @@ -79,7 +68,7 @@ class InetAddress { sockaddr *getAddress(); const char *getHostAddress(); int getPort(); - int setAddress(const char *name); + int setAddress(const std::string& name); void setPort(int port); bool isMulticastAddress(); |