Changeset 561 for trunk/src/network/socket/qnativesocketengine_p.h
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/network/socket/qnativesocketengine_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtNetwork module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 53 53 // We mean it. 54 54 // 55 56 55 #include "QtNetwork/qhostaddress.h" 57 56 #include "private/qabstractsocketengine_p.h" 58 57 #ifndef Q_OS_WIN 59 #include "qplatformdefs.h" 58 # include "qplatformdefs.h" 59 #else 60 # include <winsock2.h> 61 #endif 62 63 #ifdef Q_OS_SYMBIAN 64 #include <private/qeventdispatcher_symbian_p.h> 65 #include <unistd.h> 60 66 #endif 61 67 62 68 QT_BEGIN_NAMESPACE 63 69 64 #ifndef Q_OS_WIN 65 // Almost always the same. If not, specify in qplatformdefs.h. 66 #if !defined(QT_SOCKOPTLEN_T) 67 # define QT_SOCKOPTLEN_T QT_SOCKLEN_T 68 #endif 69 70 // Tru64 redefines accept -> _accept with _XOPEN_SOURCE_EXTENDED 71 static inline int qt_socket_accept(int s, struct sockaddr *addr, QT_SOCKLEN_T *addrlen) 72 { return ::accept(s, addr, static_cast<QT_SOCKLEN_T *>(addrlen)); } 73 #if defined(accept) 74 # undef accept 75 #endif 76 77 // UnixWare 7 redefines listen -> _listen 78 static inline int qt_socket_listen(int s, int backlog) 79 { return ::listen(s, backlog); } 80 #if defined(listen) 81 # undef listen 82 #endif 83 84 // UnixWare 7 redefines socket -> _socket 85 static inline int qt_socket_socket(int domain, int type, int protocol) 86 { return ::socket(domain, type, protocol); } 87 #if defined(socket) 88 # undef socket 89 #endif 90 91 #endif 70 // Use our own defines and structs which we know are correct 71 # define QT_SS_MAXSIZE 128 72 # define QT_SS_ALIGNSIZE (sizeof(qint64)) 73 # define QT_SS_PAD1SIZE (QT_SS_ALIGNSIZE - sizeof (short)) 74 # define QT_SS_PAD2SIZE (QT_SS_MAXSIZE - (sizeof (short) + QT_SS_PAD1SIZE + QT_SS_ALIGNSIZE)) 75 struct qt_sockaddr_storage { 76 short ss_family; 77 char __ss_pad1[QT_SS_PAD1SIZE]; 78 qint64 __ss_align; 79 char __ss_pad2[QT_SS_PAD2SIZE]; 80 }; 81 82 // sockaddr_in6 size changed between old and new SDK 83 // Only the new version is the correct one, so always 84 // use this structure. 85 struct qt_in6_addr { 86 quint8 qt_s6_addr[16]; 87 }; 88 struct qt_sockaddr_in6 { 89 short sin6_family; /* AF_INET6 */ 90 quint16 sin6_port; /* Transport level port number */ 91 quint32 sin6_flowinfo; /* IPv6 flow information */ 92 struct qt_in6_addr sin6_addr; /* IPv6 address */ 93 quint32 sin6_scope_id; /* set of interfaces for a scope */ 94 }; 95 96 union qt_sockaddr { 97 sockaddr a; 98 sockaddr_in a4; 99 qt_sockaddr_in6 a6; 100 qt_sockaddr_storage storage; 101 }; 92 102 93 103 class QNativeSocketEnginePrivate; … … 125 135 bool hasPendingDatagrams() const; 126 136 qint64 pendingDatagramSize() const; 137 138 127 139 128 140 qint64 receiveBufferSize() const;
Note:
See TracChangeset
for help on using the changeset viewer.