13 #ifndef LINKLOCALMANAGER_H___
14 #define LINKLOCALMANAGER_H___
20 #include "linklocal.h"
25 #include "connectiontcpserver.h"
36 class ConnectionHandler;
37 class ConnectionTCPClient;
199 void addTXTData(
const std::string& key,
const std::string& value );
208 void removeTXTData(
const std::string& key );
215 void registerService();
221 void deregisterService();
229 void setUser(
const std::string& user ) { m_user = user; }
238 void setHost(
const std::string& host ) { m_host = host; }
247 void setDomain(
const std::string& domain ) { m_domain = domain; }
259 void setPort(
const int port ) { m_port = port; addTXTData(
"port.p2pj", util::int2string( m_port ) ); }
280 bool startBrowsing();
294 int socket()
const {
return m_browseFd; }
301 void recv(
int timeout );
316 static void handleBrowseReply( DNSServiceRef sdRef, DNSServiceFlags flags,
unsigned interfaceIndex,
317 DNSServiceErrorType errorCode,
const char* serviceName,
const char* regtype,
318 const char* replyDomain,
void* context );
320 void handleBrowse(
Flag flag,
const std::string& service,
const std::string& regtype,
const std::string& domain,
int iface,
bool moreComing );
322 typedef std::list<ConnectionTCPClient*> ConnectionList;
323 typedef std::map<ConnectionTCPClient*, const JID> ConnectionMap;
325 DNSServiceRef m_publishRef;
326 DNSServiceRef m_browseRef;
333 std::string m_domain;
334 unsigned m_interface;
356 #endif // LINKLOCALMANAGER_H___
This is an implementation of a simple listening TCP connection.
void setDomain(const std::string &domain)
void setHost(const std::string &host)
This is an abstract base class to receive incoming connection attempts. Do not confuse this with Conn...
The namespace for the gloox library.
void setUser(const std::string &user)
std::map< std::string, std::string > StringMap
void registerLinkLocalHandler(Handler *handler)
A base class that gets informed about advertised or removed XMPP services on the local network...
void setPort(const int port)
This is a manager for server-less messaging (XEP-0174).
void setInterface(unsigned iface)
An implementation of log sink and source.
std::list< Service > ServiceList