Yate: SocketFilter Class Reference

Yate

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Friends | List of all members
SocketFilter Class Referenceabstract

A filter for received socket data. More...

`#include <yateclass.h>`

Inheritance diagram for SocketFilter:

## Public Member Functions
| SocketFilter ()
virtual | ~SocketFilter ()
virtual void * | getObject (const String &name) const
virtual void | timerTick (const Time &when)
virtual bool | received (void *buffer, int length, int flags, const struct sockaddr *addr, socklen_t adrlen)=0
Socket * | socket () const
bool | valid () const
Public Member Functions inherited from GenObject
| GenObject ()
virtual | ~GenObject ()
virtual bool | alive () const
virtual void | destruct ()
virtual const String & | toString () const
virtual const String & | traceId () const
NamedCounter * | getObjCounter () const
NamedCounter * | setObjCounter (NamedCounter *counter)

## Friends
class | Socket

## Additional Inherited Members
Static Public Member Functions inherited from GenObject
static void * | getObject (const String &name, const GenObject *obj)
static bool | getObjCounting ()
static void | setObjCounting (bool enable)
static NamedCounter * | getObjCounter (const String &name, bool create=true)
static ObjList & | getObjCounters ()

## Detailed Description

A filter for received socket data.

Abstract interface for an object that filters socket received data packets

## Constructor & Destructor Documentation

SocketFilter | ( |  | ) |

Constructor

virtual ~SocketFilter | ( |  | ) |
| virtual

Destructor, unregisters from socket

## Member Function Documentation

virtual void* getObject | ( | const String & | name | ) | const
| virtual

Get a pointer to a derived class given that class name

Parameters

  name | Name of the class we are asking for

Returns
  Pointer to the requested class or NULL if this object doesn't implement it

Reimplemented from GenObject.

virtual bool received | ( | void * | buffer,
|  | int | length,
|  | int | flags,
|  | const struct sockaddr * | addr,
|  | socklen_t | adrlen
| ) |  |
| pure virtual

Notify this filter about a received block of data

Parameters

  buffer | Buffer for received data
  length | Length of the data in buffer
  flags | Operating system specific bit flags of the operation
  addr | Address of the incoming data, may be NULL
  adrlen | Length of the valid data in address structure

Returns
  True if this filter claimed the data

Socket* socket | ( |  | ) | const
| inline

Get the socket to which the filter is currently attached

Returns
  Pointer to the socket of this filter

virtual void timerTick | ( | const Time & | when | ) |
| virtual

Run whatever actions required on idle thread runs

Parameters

  when | Time when the idle run started

bool valid | ( |  | ) | const

Check if the socket of this filter is valid

Returns
  True if the filter has a valid socket

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

- yateclass.h