Main Page | Compound List | File List | Compound Members | File Members | Related Pages

# beeplisten.h File Reference

The Listener Object. More...

Go to the source code of this file.

## Compounds
struct | sbLstnObject
| The beep listener object. More...
## Defines
#define | __LIB3195_BEEPLISTEN_H_INCLUDED__ 1
#define | sbLstnCHECKVALIDOBJECT(x) {assert(x != NULL); assert(x->OID == OIDsbLstn);}
## Typedefs
typedef sbLstnObject | sbLstnObj
## Functions
srRetVal | sbLstnInit (sbLstnObj *pThis)
| Initialize a listener.
srRetVal | sbLstnRun (sbLstnObj *pThis)
| THE listener process.
srRetVal | sbLstnExit (sbLstnObj *pThis)
| Exit the listener.
srRetVal | sbLstnAddProfile (struct sbLstnObject *pThis, struct sbProfObject *pProf)
| Add a profile object to the current listener object.
void | sbLstnDestroy (sbLstnObj *pThis)
| Destructor for the beep listener object.
sbLstnObj * | sbLstnConstruct (void)
| Construct a sbLstnObj.

## Detailed Description

The Listener Object.

Author:
  Rainer Gerhards <rgerhards@adiscon.com>

Date:
  2003-08-13 first version begun.

  2003-09-29 Changed this object so that it is no longer "just" BEEP listener but a general listener. As of 2003-09-29, it supports UDP (RFC 3164) in addition to BEEP. Later versions will probably support other transports, too.

Copyright 2002-2003 Rainer Gerhards and Adiscon GmbH. All Rights Reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of Adiscon GmbH or Rainer Gerhards nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

## Function Documentation

srRetVal sbLstnAddProfile | ( | struct sbLstnObject * | pThis,
|  | struct sbProfObject * | pProf
| ) |

| Add a profile object to the current listener object. The profile becomes active with the next greeting. For convenience, the key is set to the profile URI.

sbLstnObj* sbLstnConstruct | ( | void |  | ) |

  | Construct a sbLstnObj. This MUST be the first call a server makes. After the server has obtained the sbLstnObj, it can set the parameters and THEN call sbLstnInit(). Return values:
  pointer | to constructed object or NULL, if error occurred.

srRetVal sbLstnExit | ( | sbLstnObj * | pThis | ) |

| Exit the listener. Will do all cleanup necessary.

srRetVal sbLstnInit | ( | sbLstnObj * | pThis | ) |

  | Initialize a listener. The listener socket is created, but it is not yet set to listen() to incoming calls. Parameters:
  pThis | {out] Pointer to a pointer to the object. On return, it contains a pointer to a new BEEP listener object or NULL, if an error occured. Consult the return value to learn more in the later case.

srRetVal sbLstnRun | ( | sbLstnObj * | pThis | ) |

| THE listener process. Todo: think of a smart way to handle iRet down here... For now, we just make sure BEEP is closed last, as this has the highest potential for errors.