Poco::Net

class SocketNotifier

Library: Net
Package: Reactor
Header: Poco/Net/SocketNotifier.h

Description

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

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Member Summary

Member Functions: accepts, addObserver, dispatch, hasObservers, removeObserver

Inherited Functions: duplicate, referenceCount, release

Constructors

SocketNotifier

SocketNotifier(
    const Socket & socket
);

Creates the SocketNotifier for the given socket.

Destructor

~SocketNotifier protected virtual

~SocketNotifier();

Destroys the SocketNotifier.

Member Functions

accepts inline

bool accepts(
    SocketNotification * pNotification
);

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

addObserver

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

Adds the given observer.

dispatch

void dispatch(
    SocketNotification * pNotification
);

Dispatches the notification to all observers.

hasObservers inline

bool hasObservers() const;

Returns true if there are subscribers.

removeObserver

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

Removes the given observer.