44 #ifndef COMMONCPP_DCCP_H_
45 #define COMMONCPP_DCCP_H_
49 #ifndef COMMONCPP_CONFIG_H_
50 #include <commoncpp/config.h>
53 #ifndef COMMONCPP_STRING_H_
57 #ifndef COMMONCPP_ADDRESS_H_
61 #ifndef COMMONCPP_SOCKET_H_
93 class __EXPORT DCCPSocket :
public Socket
97 struct sockaddr_in ipv4;
99 struct sockaddr_in6 ipv6;
117 virtual bool onAccept(
const IPV4Host &ia, tpport_t port);
119 virtual bool onAccept(
const IPV6Host &ia, tpport_t port);
122 virtual IPV4Host getIPV4Sender(tpport_t *port = NULL)
const;
125 virtual IPV6Host getIPV6Sender(tpport_t *port = NULL)
const;
139 DCCPSocket(
const IPV4Address &bind, tpport_t port,
unsigned backlog = 5);
141 DCCPSocket(
const IPV6Address &bind, tpport_t port,
unsigned backlog = 5);
153 DCCPSocket(
const char *name, Family family = IPV4,
unsigned backlog = 5);
158 DCCPSocket(Family family = IPV4);
163 DCCPSocket(DCCPSocket& server, timeout_t timeout = 0);
173 void disconnect(
void);
178 bool setCCID(uint8_t ccid);
183 int getTxCCID()
const;
188 int getRxCCID()
const;
193 size_t available()
const;
202 void connect(
const IPV4Host &host, tpport_t port, timeout_t timeout = 0);
204 void connect(
const IPV6Host &host, tpport_t port, timeout_t timeout = 0);
210 void connect(
const char *name);
217 inline bool isPendingConnection(timeout_t timeout = TIMEOUT_INF) {
218 return Socket::isPending(Socket::pendingInput, timeout);
224 virtual ~DCCPSocket();
Network addresses and sockets related classes.
Common C++ generic string class.