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 interface,
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___