PTLib  Version 2.14.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PSSDP Class Reference

Simple Service Discovery Protocol. More...

#include <ssdp.h>

Inheritance diagram for PSSDP:
Collaboration diagram for PSSDP:

Public Types

enum  Commands { M_SEARCH = PHTTP::NumCommands, NOTIFY, NumCommands }
 
- Public Types inherited from PHTTP
enum  Commands {
  GET, HEAD, POST, PUT,
  DELETE, TRACE, OPTIONS, CONNECT,
  NumCommands
}
 
enum  StatusCode {
  BadResponse = 1, ContentProcessorError, UnknownTransferEncoding, Continue = 100,
  SwitchingProtocols, RequestOK = 200, Created, Accepted,
  NonAuthoritativeInformation, NoContent, ResetContent, PartialContent,
  MultipleChoices = 300, MovedPermanently, MovedTemporarily, SeeOther,
  NotModified, UseProxy, BadRequest = 400, UnAuthorised,
  PaymentRequired, Forbidden, NotFound, MethodNotAllowed,
  NoneAcceptable, ProxyAuthenticationRequired, RequestTimeout, Conflict,
  Gone, LengthRequired, UnlessTrue, InternalServerError = 500,
  NotImplemented, BadGateway, ServiceUnavailable, GatewayTimeout
}
 

Public Member Functions

 PSSDP ()
 Create a TCP/IP HTTP protocol channel. More...
 
bool Listen ()
 Listen for service notifications. More...
 
bool Search (const PString &urn, PMIMEInfo &reply)
 Search for device with the specified URN. More...
 
bool GetNotify (PMIMEInfo &mime, const PString &urnRegex=".*")
 Read a notification. More...
 

Static Public Member Functions

static const PCaselessStringMXTag ()
 
static const PCaselessStringSTTag ()
 
static const PCaselessStringMANTag ()
 
static const PCaselessStringUSNTag ()
 
static const PCaselessStringNickNameTag ()
 
- Static Public Member Functions inherited from PHTTP
static const PCaselessStringHostTag ()
 
static const PCaselessStringAllowTag ()
 
static const PCaselessStringAuthorizationTag ()
 
static const PCaselessStringContentEncodingTag ()
 
static const PCaselessStringContentLengthTag ()
 
static const PCaselessStringContentTypeTag ()
 
static const PCaselessStringDateTag ()
 
static const PCaselessStringExpiresTag ()
 
static const PCaselessStringFromTag ()
 
static const PCaselessStringIfModifiedSinceTag ()
 
static const PCaselessStringLastModifiedTag ()
 
static const PCaselessStringLocationTag ()
 
static const PCaselessStringPragmaTag ()
 
static const PCaselessStringPragmaNoCacheTag ()
 
static const PCaselessStringRefererTag ()
 
static const PCaselessStringServerTag ()
 
static const PCaselessStringUserAgentTag ()
 
static const PCaselessStringWWWAuthenticateTag ()
 
static const PCaselessStringMIMEVersionTag ()
 
static const PCaselessStringConnectionTag ()
 
static const PCaselessStringKeepAliveTag ()
 
static const PCaselessStringUpgradeTag ()
 
static const PCaselessStringWebSocketTag ()
 
static const PCaselessStringWebSocketKeyTag ()
 
static const PCaselessStringWebSocketAcceptTag ()
 
static const PCaselessStringWebSocketProtocolTag ()
 
static const PCaselessStringWebSocketVersionTag ()
 
static const PCaselessStringTransferEncodingTag ()
 
static const PCaselessStringChunkedTag ()
 
static const PCaselessStringProxyConnectionTag ()
 
static const PCaselessStringProxyAuthorizationTag ()
 
static const PCaselessStringProxyAuthenticateTag ()
 
static const PCaselessStringForwardedTag ()
 
static const PCaselessStringSetCookieTag ()
 
static const PCaselessStringCookieTag ()
 

Protected Member Functions

bool Close ()
 Close the channel. More...
 
- Protected Member Functions inherited from PHTTP
 PHTTP ()
 Create a TCP/IP HTTP protocol channel. More...
 
 PHTTP (const char *defaultServiceName)
 
virtual PINDEX ParseResponse (const PString &line)
 Parse a response line string into a response code and any extra info on the line. More...
 
- Protected Member Functions inherited from PInternetProtocol
 PInternetProtocol (const char *defaultServiceName, PINDEX cmdCount, char const *const *cmdNames)
 
- Protected Member Functions inherited from PIndirectChannel
virtual PBoolean OnOpen ()
 This callback is executed when the Open() function is called with open channels. More...
 
- Protected Member Functions inherited from PChannel
 PChannel (const PChannel &)
 
PChanneloperator= (const PChannel &)
 
virtual PBoolean ConvertOSError (P_INT_PTR libcReturnValue, ErrorGroup group=LastGeneralError)
 Convert an operating system error into platform independent error. More...
 
int ReadCharWithTimeout (PTimeInterval &timeout)
 Read a character with specified timeout. More...
 
PBoolean ReceiveCommandString (int nextChar, const PString &reply, PINDEX &pos, PINDEX start)
 
virtual int os_errno () const
 
PBoolean PXSetIOBlock (PXBlockType type, const PTimeInterval &timeout)
 
P_INT_PTR GetOSHandleAsInt () const
 
int PXClose ()
 
 PChannel ()
 Create the channel. More...
 
- Protected Member Functions inherited from PObject
 PObject ()
 Constructor for PObject, made protected so cannot ever create one on its own. More...
 

Protected Attributes

bool m_listening
 

Additional Inherited Members

- Protected Types inherited from PInternetProtocol
enum  StuffState {
  DontStuff, StuffIdle, StuffCR, StuffCRLF,
  StuffCRLFdot, StuffCRLFdotCR
}
 
- Friends inherited from PObject

Detailed Description

Simple Service Discovery Protocol.

Member Enumeration Documentation

Enumerator
M_SEARCH 
NOTIFY 
NumCommands 

Constructor & Destructor Documentation

PSSDP::PSSDP ( )

Create a TCP/IP HTTP protocol channel.

Member Function Documentation

bool PSSDP::Close ( )
protectedvirtual

Close the channel.

This will detach itself from the read and write channels and delete both of them if they are auto delete.

Returns
true if the channel is closed.

Reimplemented from PIndirectChannel.

bool PSSDP::GetNotify ( PMIMEInfo mime,
const PString urnRegex = ".*" 
)

Read a notification.

bool PSSDP::Listen ( )

Listen for service notifications.

static const PCaselessString& PSSDP::MANTag ( )
static
static const PCaselessString& PSSDP::MXTag ( )
static
static const PCaselessString& PSSDP::NickNameTag ( )
static
bool PSSDP::Search ( const PString urn,
PMIMEInfo reply 
)

Search for device with the specified URN.

Note that the Listen() must not have been called for this function to work correctly.

Parameters
urnResource identfier to search for
replyMIME for the reply
static const PCaselessString& PSSDP::STTag ( )
static
static const PCaselessString& PSSDP::USNTag ( )
static

Member Data Documentation

bool PSSDP::m_listening
protected

The documentation for this class was generated from the following file: