Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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)
ThreadReturn run ()

Public Attributes

void exception char[] msg
public class VersionAres typedef
void 
ThreadReturn
else typedef int ThreadReturn

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 84 of file SocketListener.d.

References assert(), and buffer.

public class VersionAltListener void start  )  [inline]
 

Definition at line 98 of file SocketListener.d.

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.

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 125 of file SocketListener.d.

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 140 of file SocketListener.d.

ThreadReturn run  )  [inline]
 

Definition at line 163 of file SocketListener.d.

References buffer, printf(), ISocketReader::read(), and version.


Member Data Documentation

bool quit [private]
 

Definition at line 70 of file SocketListener.d.

IBuffer buffer [private]
 

Reimplemented in BulletinConsumer.

Definition at line 71 of file SocketListener.d.

ISocketReader reader [private]
 

Reimplemented in BulletinConsumer.

Definition at line 72 of file SocketListener.d.

int limit = 3 [private]
 

Definition at line 73 of file SocketListener.d.

void exception char [] msg
 

Handle error conditions from the listener thread.

Definition at line 116 of file SocketListener.d.

public class VersionAres typedef void ThreadReturn
 

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 158 of file SocketListener.d.

else typedef int ThreadReturn
 

Definition at line 161 of file SocketListener.d.


The documentation for this class was generated from the following file:
Generated on Sat Dec 24 17:28:42 2005 for Mango by  doxygen 1.4.0