HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_SocketListener Class Referenceabstract

#include <UT_SocketListener.h>

Public Member Functions

virtual ~UT_SocketListener ()
 Calls stop(). More...
 
int getEventTypes () const
 
UT_NetSocketgetSocket () const
 Returns the socket that is being monitored. More...
 
bool isListening () const
 Returns true if the socket is being monitored for events. More...
 
void setEventTypes (int event_types)
 
void start ()
 
void stop ()
 
virtual int64 getMemoryUsage (bool inclusive) const
 Returns the amount of memory owned by this UT_SocketListener. More...
 

Protected Member Functions

 UT_SocketListener (UT_NetSocket *socket, int event_types=UT_SOCKET_READ_READY)
 
virtual void onSocketEvent (int event_types)=0
 

Detailed Description

Definition at line 31 of file UT_SocketListener.h.

Constructor & Destructor Documentation

virtual UT_SocketListener::~UT_SocketListener ( )
virtual

Calls stop().

UT_SocketListener::UT_SocketListener ( UT_NetSocket socket,
int  event_types = UT_SOCKET_READ_READY 
)
protected

Constructs an instance of UT_SocketListener that monitors the specified socket for the specified event types. onSocketEvent() is called whenever the specified events occur.

Member Function Documentation

int UT_SocketListener::getEventTypes ( ) const
inline

Returns a bitmask of UT_SocketListenerEvents indicating which events trigger a call to onSocketEvent().

Definition at line 41 of file UT_SocketListener.h.

virtual int64 UT_SocketListener::getMemoryUsage ( bool  inclusive) const
virtual

Returns the amount of memory owned by this UT_SocketListener.

UT_NetSocket* UT_SocketListener::getSocket ( ) const
inline

Returns the socket that is being monitored.

Definition at line 44 of file UT_SocketListener.h.

bool UT_SocketListener::isListening ( ) const
inline

Returns true if the socket is being monitored for events.

Definition at line 47 of file UT_SocketListener.h.

virtual void UT_SocketListener::onSocketEvent ( int  event_types)
protectedpure virtual

Subclasses must implement this method in order to receive notification of socket events (such as data being available for reading). event_types is a bitmask of UT_SocketListenerEvents and indicates which events were fired.

void UT_SocketListener::setEventTypes ( int  event_types)

Sets the events that trigger a call to onSocketEvent(). event_types is a bitmask of UT_SocketListenerEvents.

void UT_SocketListener::start ( )

Start/stop listening on the socket provided to create(). Successive calls to either method have no effect.

void UT_SocketListener::stop ( )

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