• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • dnssd
 

dnssd

  • DNSSD
  • PublicService
Signals | Public Member Functions | Protected Member Functions | List of all members
DNSSD::PublicService Class Reference

#include <publicservice.h>

Inheritance diagram for DNSSD::PublicService:
DNSSD::ServiceBase

Signals

void published (bool)
 

Public Member Functions

 PublicService (const TQString &name=TQString::null, const TQString &type=TQString::null, unsigned int port=0, const TQString &domain=TQString::null)
 
void stop ()
 
bool publish ()
 
bool isPublished () const
 
void publishAsync ()
 
void setTextData (const TQMap< TQString, TQString > &textData)
 
void setServiceName (const TQString &serviceName)
 
void setType (const TQString &type)
 
void setPort (unsigned short port)
 
void setDomain (const TQString &domain)
 
const KURL toInvitation (const TQString &host=TQString::null)
 
- Public Member Functions inherited from DNSSD::ServiceBase
 ServiceBase (const TQString &name=TQString::null, const TQString &type=TQString::null, const TQString &domain=TQString::null, const TQString &host=TQString::null, unsigned short port=0)
 
const TQString & serviceName () const
 
const TQString & type () const
 
const TQString & domain () const
 
const TQString & hostName () const
 
unsigned short port () const
 
const TQMap< TQString, TQString > & textData () const
 

Protected Member Functions

virtual void customEvent (TQCustomEvent *event)
 
virtual void virtual_hook (int, void *)
 
- Protected Member Functions inherited from DNSSD::ServiceBase
TQString encode ()
 
void decode (const TQString &name)
 
virtual void virtual_hook (int, void *)
 

Additional Inherited Members

- Public Types inherited from DNSSD::ServiceBase
typedef TDESharedPtr< ServiceBase > Ptr
 
- Protected Attributes inherited from DNSSD::ServiceBase
TQString m_serviceName
 
TQString m_type
 
TQString m_domain
 
TQString m_hostName
 
unsigned short m_port
 
TQMap< TQString, TQString > m_textData
 

Detailed Description

This class is most important for application that wants to announce its service on network.

Suppose that you want to make your web server public - this is simplest way:

DNSSD::PublicService *service = new DNSSD::PublicService("My files","_http._tcp",80);
bool isOK = service->publish();
DNSSD::PublicService
This class is most important for application that wants to announce its service on network.
Definition: publicservice.h:62
DNSSD::PublicService::publish
bool publish()
Synchrounous publish.
Definition: publicservice.cpp:172

In this example publish() is synchronous - it will not return until publishing is complete. This is usually not too long but it can freeze application's GUI for a moment. Asynchronous publishing is better for responsiveness. Example:

DNSSD::PublicService *service = new DNSSD::PublicService("My files","_http._tcp",80);
connect(service,TQ_SIGNAL(published(bool)),this,TQ_SLOT(wasPublished(bool)));
service->publishAsync();
DNSSD::PublicService::published
void published(bool)
Emitted when publishing is complete - parameter is set to true if it was successfull.
DNSSD::PublicService::publishAsync
void publishAsync()
Asynchronous version of publish().
Definition: publicservice.cpp:237

This class represents local service being published

Author
Jakub Stachowski

Definition at line 61 of file publicservice.h.

Constructor & Destructor Documentation

◆ PublicService()

DNSSD::PublicService::PublicService ( const TQString &  name = TQString::null,
const TQString &  type = TQString::null,
unsigned int  port = 0,
const TQString &  domain = TQString::null 
)
Parameters
nameService name. If set to TQString::null, computer name will be used and will be available via serviceName() after successful registration
typeService type. Has to be in form _sometype._udp or _sometype._tcp
portPort number. Set to 0 to "reserve" service name.
domainDomain name. If left as TQString:null, user configuration will be used. "local." means local LAN

Definition at line 77 of file publicservice.cpp.

◆ ~PublicService()

DNSSD::PublicService::~PublicService ( )

Definition at line 94 of file publicservice.cpp.

Member Function Documentation

◆ customEvent()

void DNSSD::PublicService::customEvent ( TQCustomEvent *  event)
protectedvirtual

Definition at line 285 of file publicservice.cpp.

◆ isPublished()

bool DNSSD::PublicService::isPublished ( ) const

Returns true is currently published.

Definition at line 167 of file publicservice.cpp.

◆ publish()

bool DNSSD::PublicService::publish ( )

Synchrounous publish.

Application will be freezed until publishing is complete.

Returns
true if successfull.

Definition at line 172 of file publicservice.cpp.

◆ publishAsync()

void DNSSD::PublicService::publishAsync ( )

Asynchronous version of publish().

It return immediately and emits signal published(bool) when completed. Note that in case of early detected error (like bad service type) signal may be emitted before return of this function.

Definition at line 237 of file publicservice.cpp.

◆ published

void DNSSD::PublicService::published ( bool  )
signal

Emitted when publishing is complete - parameter is set to true if it was successfull.

It will also emitted when name, port or type of already published service is changed.

◆ setDomain()

void DNSSD::PublicService::setDomain ( const TQString &  domain)

Sets domain where service is published.

"local." means local LAN. If service is currently published, it will be re-announced with new data.

Definition at line 122 of file publicservice.cpp.

◆ setPort()

void DNSSD::PublicService::setPort ( unsigned short  port)

Sets port.

If service is currently published, it will be re-announced with new data.

Definition at line 145 of file publicservice.cpp.

◆ setServiceName()

void DNSSD::PublicService::setServiceName ( const TQString &  serviceName)

Sets name of the service.

If service is currently published, it will be re-announced with new data.

Definition at line 111 of file publicservice.cpp.

◆ setTextData()

void DNSSD::PublicService::setTextData ( const TQMap< TQString, TQString > &  textData)

Sets new text properties.

If services is already published, it will be re-announced with new data.

Definition at line 156 of file publicservice.cpp.

◆ setType()

void DNSSD::PublicService::setType ( const TQString &  type)

Sets type of service.

It has to in form of _type._udp or _type._tcp. If service is currently published, it will be re-announced with new data.

Definition at line 134 of file publicservice.cpp.

◆ stop()

void DNSSD::PublicService::stop ( )

Stops publishing or abort incomplete publish request.

Useful when you want to disable service for some time.

Definition at line 179 of file publicservice.cpp.

◆ toInvitation()

const KURL DNSSD::PublicService::toInvitation ( const TQString &  host = TQString::null)

Translates service into URL that can be sent to another user.

Parameters
hostUse specified hostname. If left empty, public IP address (the one used for default route) will be used.
Since
3.5

Definition at line 265 of file publicservice.cpp.

◆ virtual_hook()

void DNSSD::PublicService::virtual_hook ( int  ,
void *   
)
protectedvirtual

Reimplemented from DNSSD::ServiceBase.

Definition at line 299 of file publicservice.cpp.


The documentation for this class was generated from the following files:
  • publicservice.h
  • publicservice.cpp

dnssd

Skip menu "dnssd"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

dnssd

Skip menu "dnssd"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for dnssd by doxygen 1.9.4
This website is maintained by Timothy Pearson.