Public Member Functions | List of all members
BUrlProtocolAsynchronousListener Class Reference

Provides a handler for BUrlProtocolDispatchingListener. More...

Inherits BHandler, and BUrlProtocolListener.

Public Member Functions

 BUrlProtocolAsynchronousListener (bool transparent=false)
 Create a BUrlProtocolAsynchronousListener. More...
 
virtual ~BUrlProtocolAsynchronousListener ()
 Default destructor for BUrlProtocolAsynchronousListener. More...
 
virtual void MessageReceived (BMessage *message)
 Handle messages that has been received by the associated looper. More...
 
BUrlProtocolListenerSynchronousListener ()
 The synchronous listener created from the current object. More...
 
- Public Member Functions inherited from BHandler
 BHandler (const char *name=NULL)
 Construct a new handler with a name. More...
 
virtual ~BHandler ()
 Free the filters of this handler, as well as the list of observers. More...
 
virtual status_t Perform (perform_code d, void *arg)
 Perform some action (Internal method defined for binary compatibility purposes).
 
 BHandler (BMessage *data)
 Construct a handler from an archived message. More...
 
virtual status_t Archive (BMessage *data, bool deep=true) const
 Archive a handler to a message. More...
 
BLooperLooper () const
 Return a pointer to the looper that this handler is associated with. More...
 
void SetName (const char *name)
 Set or change the name of this handler. More...
 
const char * Name () const
 Return the name of this handler. More...
 
virtual void SetNextHandler (BHandler *handler)
 Set the next handler in the chain that the message is passed on to if this handler cannot process it. More...
 
BHandlerNextHandler () const
 Return the next hander in the chain to which the message is passed on. More...
 
virtual void AddFilter (BMessageFilter *filter)
 Add filter as a prerequisite to this handler. More...
 
virtual bool RemoveFilter (BMessageFilter *filter)
 Remove filter from the filter list. More...
 
virtual void SetFilterList (BList *filters)
 Set the internal list of filters to filters. More...
 
BListFilterList ()
 Return a pointer to the list of filters. More...
 
bool LockLooper ()
 Lock the looper associated with this handler. More...
 
status_t LockLooperWithTimeout (bigtime_t timeout)
 Lock the looper associated with this handler, with a time out value. More...
 
void UnlockLooper ()
 Unlock the looper. More...
 
virtual BHandlerResolveSpecifier (BMessage *message, int32 index, BMessage *specifier, int32 what, const char *property)
 Determine the proper handler for a scripting message. More...
 
virtual status_t GetSupportedSuites (BMessage *data)
 Reports the suites of messages and specifiers that derived classes understand. More...
 
status_t StartWatching (BMessenger target, uint32 what)
 Subscribe this handler to watch a specific state change of a target. More...
 
status_t StartWatchingAll (BMessenger target)
 Subscribe this handler to watch a target for all events. More...
 
status_t StopWatching (BMessenger target, uint32 what)
 Unsubscribe this handler from watching a specific state. More...
 
status_t StopWatchingAll (BMessenger target)
 Unsubscribe this handler from watching all states. More...
 
status_t StartWatching (BHandler *observer, uint32 what)
 Subscribe an observer for a specific state change of this handler. More...
 
status_t StartWatchingAll (BHandler *observer)
 Subscribe an observer for a all state changes. More...
 
status_t StopWatching (BHandler *observer, uint32 what)
 Unsubscribe an observer from watching a specific state. More...
 
status_t StopWatchingAll (BHandler *observer)
 Unsubscribe an observer from watching all states. More...
 
virtual void SendNotices (uint32 what, const BMessage *notice=NULL)
 Emit a state change to the observers. More...
 
bool IsWatched () const
 Check if there are any observers watching this handler. More...
 
- Public Member Functions inherited from BArchivable
 BArchivable ()
 Constructor. Does nothing. More...
 
 BArchivable (BMessage *from)
 Constructor. Does important behind-the-scenes work in the unarchiving process. More...
 
virtual ~BArchivable ()
 Destructor. Does nothing. More...
 
virtual status_t AllArchived (BMessage *archive) const
 Method relating to the use of BArchiver. More...
 
virtual status_t AllUnarchived (const BMessage *archive)
 Method relating to the use of BUnarchiver. More...
 
- Public Member Functions inherited from BUrlProtocolListener
virtual bool CertificateVerificationFailed (BUrlRequest *caller, BCertificate &certificate, const char *message)
 Called when cerificate verification failed. More...
 
virtual void ConnectionOpened (BUrlRequest *caller)
 Called when the socket is opened. More...
 
virtual void DataReceived (BUrlRequest *caller, const char *data, off_t position, ssize_t size)
 Called each time a block of data is received. More...
 
virtual void DebugMessage (BUrlRequest *caller, BUrlProtocolDebugMessage type, const char *text)
 Called each time a debug message is emitted. More...
 
virtual void DownloadProgress (BUrlRequest *caller, ssize_t bytesReceived, ssize_t bytesTotal)
 Called each time a block of data is received. More...
 
virtual void HeadersReceived (BUrlRequest *caller, const BUrlResult &result)
 Called when all of the server response metadata (such as headers) have been read and parsed. More...
 
virtual void HostnameResolved (BUrlRequest *caller, const char *ip)
 Called when the final IP is discovered. More...
 
virtual void RequestCompleted (BUrlRequest *caller, bool success)
 Called once the request is complete. More...
 
virtual void ResponseStarted (BUrlRequest *caller)
 Called when the request has been emitted and the server begins to reply. More...
 
virtual void UploadProgress (BUrlRequest *caller, ssize_t bytesSent, ssize_t bytesTotal)
 Called each time a block of data is sent. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from BHandler
static BArchivableInstantiate (BMessage *data)
 Static method to instantiate a handler from an archived message. More...
 
- Static Public Member Functions inherited from BArchivable
static BArchivableInstantiate (BMessage *archive)
 Static member to restore objects from messages. More...
 

Detailed Description

Provides a handler for BUrlProtocolDispatchingListener.

BUrlProtocolAsynchronousListener transparently handles BMessage issued by BUrlProtocolDispatchingListener via callbacks from the BUrlProtocolListener interface.

Constructor & Destructor Documentation

◆ BUrlProtocolAsynchronousListener()

BUrlProtocolAsynchronousListener::BUrlProtocolAsynchronousListener ( bool  transparent = false)

Create a BUrlProtocolAsynchronousListener.

This constructor will also add the created object to the list of be_app handlers.

Parameters
transparentWhether a BUrlProtocolListener object should be created in conjunction with the current object. This object can be accessed via SynchronousListener().

◆ ~BUrlProtocolAsynchronousListener()

BUrlProtocolAsynchronousListener::~BUrlProtocolAsynchronousListener ( )
virtual

Default destructor for BUrlProtocolAsynchronousListener.

This destructor will free resources associated with the current object.

Member Function Documentation

◆ MessageReceived()

void BUrlProtocolAsynchronousListener::MessageReceived ( BMessage message)
virtual

Handle messages that has been received by the associated looper.

This handler handles messages received from BUrlProtocolDispatchingListener and handle them via callbacks as defined per BUrlProtocolListener.

Reimplemented from BHandler.

◆ SynchronousListener()

BUrlProtocolListener * BUrlProtocolAsynchronousListener::SynchronousListener ( )

The synchronous listener created from the current object.

Returns
A pointer to a BUrlProtocolListener object, or NULL if transparent was false on object creation and/or memory couldn't be allocated for the object at the time of creation.
Warning
The returned pointer lifetime is associated with the current object. Do not attempt to delete this pointer.