亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? qsocketnotifier.cpp

?? QT 開發(fā)環(huán)境里面一個(gè)很重要的文件
?? CPP
字號(hào):
/******************************************************************************** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.**** This file is part of the QtCore module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://www.trolltech.com/products/qt/opensource.html**** If you are unsure which license is appropriate for your use, please** review the following information:** http://www.trolltech.com/products/qt/licensing.html or contact the** sales department at sales@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#include "qsocketnotifier.h"#include "qplatformdefs.h"#include "qabstracteventdispatcher.h"#include "qcoreapplication.h"#include "qobject_p.h"#include <private/qthread_p.h>/*!    \class QSocketNotifier    \brief The QSocketNotifier class provides support for monitoring    activity on a file descriptor.    \ingroup io    The QSocketNotifier makes it possible to integrate Qt's event    loop with other event loops based on file descriptors. For    example, the \l{CORBA Framework} uses it to process CORBA    events.  File descriptor action is detected in Qt's main event    loop (QCoreApplication::exec()).    \target write notifiers    Once you have opened a device using a low-level (usually    platform-specific) API, you can create a socket notifier to    monitor the file descriptor. The socket notifier is enabled by    default, i.e. it emits the activated() signal whenever a socket    event corresponding to its type occurs. Connect the activated()    signal to the slot you want to be called when an event    corresponding to your socket notifier's type occurs.    There are three types of socket notifiers: read, write, and    exception. The type is described by the \l Type enum, and must be    specified when constructing the socket notifier. After    construction it can be determined using the type() function. Note    that if you need to monitor both reads and writes for the same    file descriptor, you must create two socket notifiers. Note also    that it is not possible to install two socket notifiers of the    same type (\l Read, \l Write, \l Exception) on the same socket.    The setEnabled() function allows you to disable as well as enable    the socket notifier. It is generally advisable to explicitly    enable or disable the socket notifier, especially for write    notifiers. A disabled notifier ignores socket events (the same    effect as not creating the socket notifier). Use the isEnabled()    function to determine the notifier's current status.    Finally, you can use the socket() function to retrieve the    socket identifier.  Although the class is called QSocketNotifier,    it is normally used for other types of devices than sockets.    QTcpSocket and QUdpSocket provide notification through signals, so    there is normally no need to use a QSocketNotifier on them.    \section1 Notes for Windows Users    The socket passed to QSocketNotifier will become non-blocking, even if    it was created as a blocking socket.    The activated() signal is sometimes triggered by high general activity    on the host, even if there is nothing to read. A subsequent read from    the socket can then fail, the error indicating that there is no data    available (e.g., \c{WSAEWOULDBLOCK}). This is an operating system    limitation, and not a bug in QSocketNotifier.    To ensure that the socket notifier handles read notifications correctly,    follow these steps when you receive a notification:    \list 1    \o Disable the notifier.    \o Read data from the socket.    \o Re-enable the notifier if you are interested in more data (such as after       having written a new command to a remote server).    \endlist    To ensure that the socket notifier handles write notifications correctly,    follow these steps when you receive a notification:    \list 1    \o Disable the notifier.    \o Write as much data as you can (before \c EWOULDBLOCK is returned).    \o Re-enable notifier if you have more data to write.    \endlist    \endomit    \bold{Further information:}    On Windows, Qt always disables the notifier after getting a notification,    and only re-enables it if more data is expected. For example, if data is    read from the socket and it can be used to read more, or if reading or    writing is not possible because the socket would block, in which case    it is necessary to wait before attempting to read or write again.    \sa QFile, QProcess, QTcpSocket, QUdpSocket*//*!    \enum QSocketNotifier::Type    This enum describes the various types of events that a socket    notifier can recognize. The type must be specified when    constructing the socket notifier.    Note that if you need to monitor both reads and writes for the    same file descriptor, you must create two socket notifiers. Note    also that it is not possible to install two socket notifiers of    the same type (Read, Write, Exception) on the same socket.    \value Read      There is data to be read.    \value Write      Data can be written.    \value Exception  An exception has occurred. We recommend against using this.    \sa QSocketNotifier(), type()*//*!    Constructs a socket notifier with the given \a parent. It enables    the \a socket, and watches for events of the given \a type.    It is generally advisable to explicitly enable or disable the    socket notifier, especially for write notifiers.    \bold{Note for Windows users:} The socket passed to QSocketNotifier    will become non-blocking, even if it was created as a blocking socket.    \sa setEnabled(), isEnabled()*/QSocketNotifier::QSocketNotifier(int socket, Type type, QObject *parent)    : QObject(parent){    if (socket < 0)        qWarning("QSocketNotifier: Invalid socket specified");#if defined(Q_OS_UNIX)    if (socket >= FD_SETSIZE)        qWarning("QSocketNotifier: Socket descriptor too large for select()");#endif    sockfd = socket;    sntype = type;    snenabled = true;    Q_D(QObject);    if (!d->threadData->eventDispatcher) {        qWarning("QSocketNotifier: Can only be used with threads started with QThread");    } else {        d->threadData->eventDispatcher->registerSocketNotifier(this);    }}#ifdef QT3_SUPPORT/*!    \obsolete    Use the QSocketNotifier() constructor combined with the    QObject::setObjectName() function instead.    \oldcode        QSocketNotifier *notifier = new QSocketNotifier(socket, type, parent, name);    \newcode        QSocketNotifier *notifier = new QSocketNotifier(socket, type, parent);        notifier->setObjectName(name);    \endcode*/QSocketNotifier::QSocketNotifier(int socket, Type type, QObject *parent,                                  const char *name)    : QObject(parent){    setObjectName(QString::fromAscii(name));    if (socket < 0)        qWarning("QSocketNotifier: Invalid socket specified");#if defined(Q_OS_UNIX)    if (socket >= FD_SETSIZE)        qWarning("QSocketNotifier: Socket descriptor too large for select()");#endif    sockfd = socket;    sntype = type;    snenabled = true;    Q_D(QObject);    if (!d->threadData->eventDispatcher) {        qWarning("QSocketNotifier: Can only be used with threads started with QThread");    } else {        d->threadData->eventDispatcher->registerSocketNotifier(this);    }}#endif/*!    Destroys this socket notifier.*/QSocketNotifier::~QSocketNotifier(){    setEnabled(false);}/*!    \fn void QSocketNotifier::activated(int socket)    This signal is emitted whenever the socket notifier is enabled and    a socket event corresponding to its \l {Type}{type} occurs.    The socket identifier is passed in the \a socket parameter.    \sa type(), socket()*//*!    \fn int QSocketNotifier::socket() const    Returns the socket identifier specified to the constructor.    \sa type()*//*!    \fn Type QSocketNotifier::type() const    Returns the socket event type specified to the constructor.    \sa socket()*//*!    \fn bool QSocketNotifier::isEnabled() const    Returns true if the notifier is enabled; otherwise returns false.    \sa setEnabled()*//*!    If \a enable is true, the notifier is enabled; otherwise the notifier    is disabled.    The notifier is enabled by default, i.e. it emits the activated()    signal whenever a socket event corresponding to its    \l{type()}{type} occurs. If it is disabled, it ignores socket    events (the same effect as not creating the socket notifier).    Write notifiers should normally be disabled immediately after the    activated() signal has been emitted    \sa isEnabled(), activated()*/void QSocketNotifier::setEnabled(bool enable){    if (sockfd < 0)        return;    if (snenabled == enable)                        // no change        return;    snenabled = enable;    Q_D(QObject);    if (!d->threadData->eventDispatcher) // perhaps application/thread is shutting down        return;    if (snenabled)        d->threadData->eventDispatcher->registerSocketNotifier(this);    else        d->threadData->eventDispatcher->unregisterSocketNotifier(this);}/*!\reimp*/bool QSocketNotifier::event(QEvent *e){    // Emits the activated() signal when a QEvent::SockAct is    // received.    if (e->type() == QEvent::ThreadChange) {        if (snenabled) {            QMetaObject::invokeMethod(this, "setEnabled", Qt::QueuedConnection,                                      Q_ARG(bool, snenabled));            setEnabled(false);        }    }    QObject::event(e);                        // will activate filters    if (e->type() == QEvent::SockAct) {        emit activated(sockfd);        return true;    }    return false;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99视频一区二区| 欧美成人性福生活免费看| 男女激情视频一区| 国产精品久久二区二区| 欧美一卡二卡在线观看| 色综合天天综合网天天看片| 精品一区二区三区的国产在线播放| 17c精品麻豆一区二区免费| 欧美一区二区三区视频在线观看| 91色九色蝌蚪| 国产美女娇喘av呻吟久久| 五月婷婷另类国产| 亚洲婷婷国产精品电影人久久| 精品蜜桃在线看| 在线播放国产精品二区一二区四区 | 国产精品亚洲专一区二区三区| 亚洲制服丝袜av| 中文字幕亚洲不卡| 国产午夜三级一区二区三| 日韩欧美不卡在线观看视频| 欧美三级日韩三级| 欧美在线观看18| 91国产成人在线| 97精品电影院| 成人网在线播放| 成人午夜av影视| 成人深夜视频在线观看| 国产一区二区视频在线播放| 蜜臀av在线播放一区二区三区| 亚洲va在线va天堂| 亚洲一区二区在线免费看| 成人欧美一区二区三区小说| 国产精品日韩成人| 国产精品传媒视频| 亚洲人成在线观看一区二区| 亚洲色图视频免费播放| 自拍偷拍国产精品| 亚洲欧美日韩国产综合在线| 亚洲精品日韩综合观看成人91| 亚洲天堂网中文字| 亚洲综合一二三区| 亚洲一二三四区不卡| 亚洲成人一区二区在线观看| 亚洲一区二区在线视频| 肉色丝袜一区二区| 久久99精品久久只有精品| 韩日欧美一区二区三区| 国产一区二区三区香蕉| 国产成人在线看| 成人h精品动漫一区二区三区| 91在线云播放| 日本道色综合久久| 欧美丰满美乳xxx高潮www| 日韩视频国产视频| 久久综合五月天婷婷伊人| 国产欧美一区二区三区鸳鸯浴| 欧美激情一区二区在线| 亚洲欧美日韩系列| 午夜视频一区二区三区| 日产欧产美韩系列久久99| 精品综合久久久久久8888| 国产福利一区二区三区| 91免费国产在线| 欧美日韩一区不卡| 久久亚洲精精品中文字幕早川悠里| 欧美激情一区在线观看| 亚洲一区二区三区三| 久久99热这里只有精品| 99久久婷婷国产| 欧美午夜不卡在线观看免费| 欧美成人三级在线| 国产精品丝袜一区| 日韩精品一二区| 国产福利一区二区三区在线视频| 色综合久久中文综合久久牛| 在线成人午夜影院| 国产三级三级三级精品8ⅰ区| 亚洲精品日产精品乱码不卡| 捆绑紧缚一区二区三区视频| 不卡的av中国片| 日韩亚洲欧美中文三级| 国产欧美日韩一区二区三区在线观看| 亚洲精品乱码久久久久久日本蜜臀| 日本美女一区二区三区| 成人福利视频在线看| 欧美一级日韩一级| 中文字幕亚洲区| 久久99精品一区二区三区| 日本黄色一区二区| 国产亚洲va综合人人澡精品| 午夜精品123| 风间由美一区二区av101 | 欧美日韩国产区一| 国产精品三级久久久久三级| 麻豆国产精品一区二区三区| 97精品电影院| 久久久精品2019中文字幕之3| 午夜电影久久久| 91视频你懂的| 2021中文字幕一区亚洲| 亚洲国产乱码最新视频 | 一区二区三区高清| 国产麻豆成人精品| 欧美一区二区视频在线观看| 亚洲日本va午夜在线影院| 国产真实乱偷精品视频免| 欧美日韩国产一级片| 亚洲日本成人在线观看| 国产成人av一区| 欧美一级二级三级蜜桃| 午夜久久电影网| 欧美在线观看视频一区二区| 1024精品合集| 国产91精品露脸国语对白| 日韩免费电影一区| 午夜精品一区二区三区免费视频| 91小视频在线观看| 亚洲欧洲美洲综合色网| 国产成人一区在线| 精品国产精品一区二区夜夜嗨 | 大尺度一区二区| 精品剧情v国产在线观看在线| 日本免费新一区视频| 欧美日韩综合不卡| 一区二区三区在线观看欧美| 成人av网址在线| 国产日产欧美一区| 国产91精品一区二区麻豆亚洲| 久久久99精品久久| 国产一区二区剧情av在线| 精品入口麻豆88视频| 久久www免费人成看片高清| 欧美变态凌虐bdsm| 精品亚洲成av人在线观看| 日韩欧美中文一区| 久久精品国产免费| 精品福利av导航| 国产夫妻精品视频| 国产精品久久久爽爽爽麻豆色哟哟| 成人av在线网| 亚洲乱码国产乱码精品精98午夜 | 91浏览器入口在线观看| 亚洲精品国产精华液| 欧美综合天天夜夜久久| 亚洲成av人在线观看| 制服丝袜一区二区三区| 美女免费视频一区二区| 亚洲精品一区二区三区精华液 | 日韩视频123| 精品一区二区三区免费观看| 久久新电视剧免费观看| 丰满少妇在线播放bd日韩电影| 亚洲国产激情av| 色丁香久综合在线久综合在线观看| 亚洲国产欧美在线| 日韩久久精品一区| 成人一道本在线| 亚洲精品中文在线影院| 在线综合视频播放| 国产一区二区三区最好精华液| 国产精品毛片大码女人| 在线视频你懂得一区| 日本不卡123| 国产三级三级三级精品8ⅰ区| 色哟哟精品一区| 日本视频一区二区| 国产精品理伦片| 欧美日韩和欧美的一区二区| 国产一区二区看久久| 亚洲男人都懂的| 日韩午夜在线影院| 成人免费毛片app| 亚洲18色成人| 国产三级欧美三级| 欧美日韩在线播放一区| 韩国三级电影一区二区| 亚洲精品亚洲人成人网在线播放| 91精品国产一区二区三区蜜臀| 懂色av中文字幕一区二区三区| 亚洲一区二区三区免费视频| 国产校园另类小说区| 欧美日韩视频在线观看一区二区三区| 麻豆精品一区二区综合av| 亚洲欧美日本韩国| 久久久久久久性| 欧美日本一区二区三区四区| 丁香网亚洲国际| 蜜桃视频一区二区三区在线观看| 亚洲欧洲国产日本综合| 精品乱人伦一区二区三区| 在线观看亚洲成人| 国产精品一区不卡| 免费在线一区观看| 亚洲精品国产无套在线观| 国产色产综合色产在线视频| 欧美一级在线观看| 欧美日韩一区二区三区四区五区| 东方aⅴ免费观看久久av| 久久9热精品视频| 亚洲gay无套男同|