Logo Search packages:      
Sourcecode: kdebluetooth version File versions  Download package

scoserversocket.h

//-*-c++-*-
/***************************************************************************
 *   Copyright (C) 2003 by Fred Schaettgen                                 *
 *   kdebluetooth@schaettgen.de                                            *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/

#ifndef SCOSERVERSOCKET_H
#define SCOSERVERSOCKET_H

#include <qobject.h>
#include <qsocket.h>
#include <qserversocket.h>
#include "deviceaddress.h"

class QSocketNotifier;

namespace KBluetooth
{

/** Wrapper for a listening sco-socket.
 * scoServerSocket opens a listening sco socket on a given
 * sco channel and emits a signal when there is a new incoming
 * connection. The file descriptor may be used by the receiver
 * of the signal to initialize a QSocket with it
 * (using QSocket::setSocket()).
 */
00032 class ScoServerSocket : public QObject
{
    Q_OBJECT
public:
    /** Constructor.
    @param port sco channel to listen to.
    @param parent owner object
    @param name object name
    */
    ScoServerSocket(QObject *parent = 0, char *name = 0);

    /** Destructor */
    virtual ~ScoServerSocket();

signals:
    /** Emitted when there is a new incoming connection.
    @param fd file descriptor for the already accepted socket.
    @param srcaddr source addres of the connection
    @todo srcaddr should be of type KBluetooth::DeviceAddress
    */
    void onNewConnection(int fd, KBluetooth::DeviceAddress address);

private:
    QSocketNotifier *notifier;
private slots:
    void acceptConnection(int s);
};

}

#endif

Generated by  Doxygen 1.6.0   Back to index