Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

SocketListener Class Reference

Inheritance diagram for SocketListener:

IListener BulletinConsumer MessageConsumer List of all members.

Public Member Functions

 this (ISocketReader reader, IBuffer buffer)
public class VersionAltListener
void 
start ()
void notify (IBuffer buffer)
void cancel ()
void setErrorLimit (ushort limit)
int run ()

Public Attributes

void exception char[] msg

Private Attributes

bool quit
IBuffer buffer
ISocketReader reader
int limit = 3

Member Function Documentation

this ISocketReader  reader,
IBuffer  buffer
[inline]
 

Construct a listener with the requisite arguments. The specified buffer is populated via the provided instance of ISocketReader before being passed to the notify() method. All arguments are required.

Definition at line 81 of file SocketListener.d.

public class VersionAltListener void start  )  [inline]
 

Definition at line 95 of file SocketListener.d.

Referenced by BulletinConsumer::this().

void notify IBuffer  buffer  ) 
 

Notification callback invoked whenever the listener has anything to report. The buffer will have whatever content was available from the read() operation

Reimplemented in BulletinConsumer.

Referenced by run(), and testMulticast().

void cancel  )  [inline]
 

Cancel this listener. The thread will quit only after the current read() request responds, or is interrrupted.

Reimplemented from IListener.

Reimplemented in BulletinConsumer.

Definition at line 122 of file SocketListener.d.

References quit.

void setErrorLimit ushort  limit  )  [inline]
 

Set the maximum contiguous number of exceptions this listener will survive. Setting a limit of zero will not survive any errors at all, whereas a limit of two will survive as long as two consecutive errors don't arrive back to back.

Definition at line 137 of file SocketListener.d.

int run  )  [inline]
 

Execution of this thread is typically stalled on the read() method belonging to the ISocketReader specified during construction. You can invoke cancel() to indicate execution should not proceed further, but that will not actually interrupt a blocked read() operation.

Note that exceptions are all directed towards the handler implemented by the class instance.

Definition at line 155 of file SocketListener.d.

References IBuffer::clear(), notify(), quit, ISocketReader::read(), and version.


Member Data Documentation

bool quit [private]
 

Definition at line 67 of file SocketListener.d.

Referenced by cancel(), and run().

IBuffer buffer [private]
 

Reimplemented in BulletinConsumer.

Definition at line 68 of file SocketListener.d.

ISocketReader reader [private]
 

Reimplemented in BulletinConsumer.

Definition at line 69 of file SocketListener.d.

int limit = 3 [private]
 

Definition at line 70 of file SocketListener.d.

void exception char [] msg
 

Handle error conditions from the listener thread.

Definition at line 113 of file SocketListener.d.


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:11 2004 for Mango by doxygen 1.3.6