class Poco::Net::SocketNotifier

Overview

This class is used internally by SocketReactor to notify registered event handlers of socket events. Moreā€¦

#include <SocketNotifier.h>

class SocketNotifier: public Poco::RefCountedObject
{
public:
    // construction

    SocketNotifier(const Socket& socket);

    // methods

    void
    addObserver(
        SocketReactor* pReactor,
        const Poco::AbstractObserver& observer
        );

    void
    removeObserver(
        SocketReactor* pReactor,
        const Poco::AbstractObserver& observer
        );

    bool
    hasObserver(const Poco::AbstractObserver& observer) const;

    bool
    accepts(SocketNotification* pNotification);

    void
    dispatch(SocketNotification* pNotification);

    bool
    hasObservers() const;

    std::size_t
    countObservers() const;
};

Inherited Members

public:
    // methods

    void
    duplicate() const;

    void
    release() const;

    int
    referenceCount() const;

Detailed Documentation

This class is used internally by SocketReactor to notify registered event handlers of socket events.

Construction

SocketNotifier(const Socket& socket)

Creates the SocketNotifier for the given socket.

Methods

void
addObserver(
    SocketReactor* pReactor,
    const Poco::AbstractObserver& observer
    )

Adds the given observer.

void
removeObserver(
    SocketReactor* pReactor,
    const Poco::AbstractObserver& observer
    )

Removes the given observer.

bool
hasObserver(const Poco::AbstractObserver& observer) const

Returns true if the given observer is registered.

bool
accepts(SocketNotification* pNotification)

Returns true if there is at least one observer for the given notification.

void
dispatch(SocketNotification* pNotification)

Dispatches the notification to all observers.

bool
hasObservers() const

Returns true if there are subscribers.

std::size_t
countObservers() const

Returns the number of subscribers;.