Qt 4.8
|
The QNativeSocketEngine class provides low level access to a socket. More...
#include <qnativesocketengine_p.h>
Public Slots | |
void | connectionNotification () |
If there's a connection activity on the socket, process it. More... | |
Public Slots inherited from QAbstractSocketEngine | |
void | connectionNotification () |
void | exceptionNotification () |
void | proxyAuthenticationRequired (const QNetworkProxy &proxy, QAuthenticator *authenticator) |
void | readNotification () |
void | writeNotification () |
Public Slots inherited from QObject | |
void | deleteLater () |
Schedules this object for deletion. More... | |
Public Functions | |
int | accept () |
Accepts a pending connection from the socket, which must be in ListeningState, and returns its socket descriptor. More... | |
bool | bind (const QHostAddress &address, quint16 port) |
Binds the socket to the address address and port port. More... | |
qint64 | bytesAvailable () const |
Returns the number of bytes that are currently available for reading. More... | |
qint64 | bytesToWrite () const |
void | close () |
Closes the socket. More... | |
bool | connectToHost (const QHostAddress &address, quint16 port) |
Connects to the IP address and port specified by address and port. More... | |
bool | connectToHostByName (const QString &name, quint16 port) |
Connects to the remote host name given by name on port port. More... | |
bool | hasPendingDatagrams () const |
Returns true if there is at least one datagram pending. More... | |
bool | initialize (QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol=QAbstractSocket::IPv4Protocol) |
Initializes a QNativeSocketEngine by creating a new socket of type socketType and network layer protocol protocol. More... | |
bool | initialize (int socketDescriptor, QAbstractSocket::SocketState socketState=QAbstractSocket::ConnectedState) |
Initializes the socket using socketDescriptor instead of creating a new one. More... | |
bool | isExceptionNotificationEnabled () const |
bool | isReadNotificationEnabled () const |
bool | isValid () const |
Returns true if the socket is valid; otherwise returns false. More... | |
bool | isWriteNotificationEnabled () const |
bool | joinMulticastGroup (const QHostAddress &groupAddress, const QNetworkInterface &iface) |
bool | leaveMulticastGroup (const QHostAddress &groupAddress, const QNetworkInterface &iface) |
bool | listen () |
Prepares a TCP server for accepting incoming connections. More... | |
QNetworkInterface | multicastInterface () const |
int | option (SocketOption option) const |
Returns the value of the option socketOption. More... | |
qint64 | pendingDatagramSize () const |
Returns the size of the pending datagram, or -1 if no datagram is pending. More... | |
QNativeSocketEngine (QObject *parent=0) | |
Constructs a QNativeSocketEngine. More... | |
qint64 | read (char *data, qint64 maxlen) |
Reads up to maxSize bytes into data from the socket. More... | |
qint64 | readDatagram (char *data, qint64 maxlen, QHostAddress *addr=0, quint16 *port=0) |
Reads up to maxSize bytes of a datagram from the socket, stores it in data and returns the number of bytes read. More... | |
qint64 | receiveBufferSize () const |
Returns the size of the operating system's socket receive buffer. More... | |
qint64 | sendBufferSize () const |
Returns the size of the operating system send buffer. More... | |
void | setExceptionNotificationEnabled (bool enable) |
bool | setMulticastInterface (const QNetworkInterface &iface) |
bool | setOption (SocketOption option, int value) |
Sets the option option to the value value. More... | |
void | setReadNotificationEnabled (bool enable) |
void | setReceiveBufferSize (qint64 bufferSize) |
Sets the size of the operating system receive buffer to size. More... | |
void | setSendBufferSize (qint64 bufferSize) |
Sets the size of the operating system send buffer to size. More... | |
void | setWriteNotificationEnabled (bool enable) |
int | socketDescriptor () const |
Returns the native socket descriptor. More... | |
bool | waitForRead (int msecs=30000, bool *timedOut=0) |
Waits for msecs milliseconds or until the socket is ready for reading. More... | |
bool | waitForReadOrWrite (bool *readyToRead, bool *readyToWrite, bool checkRead, bool checkWrite, int msecs=30000, bool *timedOut=0) |
bool | waitForWrite (int msecs=30000, bool *timedOut=0) |
Waits for msecs milliseconds or until the socket is ready for writing. More... | |
qint64 | write (const char *data, qint64 len) |
Writes a block of size bytes from data to the socket. More... | |
qint64 | writeDatagram (const char *data, qint64 len, const QHostAddress &addr, quint16 port) |
Writes a UDP datagram of size size bytes to the socket from data to the address host on port port, and returns the number of bytes written, or -1 if an error occurred. More... | |
~QNativeSocketEngine () | |
Destructs a QNativeSocketEngine. More... | |
Public Functions inherited from QAbstractSocketEngine | |
QAbstractSocket::SocketError | error () const |
QString | errorString () const |
QHostAddress | localAddress () const |
quint16 | localPort () const |
QHostAddress | peerAddress () const |
quint16 | peerPort () const |
QAbstractSocket::NetworkLayerProtocol | protocol () const |
QAbstractSocketEngine (QObject *parent=0) | |
void | setReceiver (QAbstractSocketEngineReceiver *receiver) |
QAbstractSocket::SocketType | socketType () const |
QAbstractSocket::SocketState | state () const |
Public Functions inherited from QObject | |
bool | blockSignals (bool b) |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More... | |
const QObjectList & | children () const |
Returns a list of child objects. More... | |
bool | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0) |
bool | disconnect (const QObject *receiver, const char *member=0) |
void | dumpObjectInfo () |
Dumps information about signal connections, etc. More... | |
void | dumpObjectTree () |
Dumps a tree of children to the debug output. More... | |
QList< QByteArray > | dynamicPropertyNames () const |
Returns the names of all properties that were dynamically added to the object using setProperty(). More... | |
virtual bool | event (QEvent *) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. More... | |
virtual bool | eventFilter (QObject *, QEvent *) |
Filters events if this object has been installed as an event filter for the watched object. More... | |
template<typename T > | |
T | findChild (const QString &aName=QString()) const |
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More... | |
template<typename T > | |
QList< T > | findChildren (const QString &aName=QString()) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More... | |
template<typename T > | |
QList< T > | findChildren (const QRegExp &re) const |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More... | |
void | installEventFilter (QObject *) |
Installs an event filter filterObj on this object. More... | |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false. More... | |
void | killTimer (int id) |
Kills the timer with timer identifier, id. More... | |
virtual const QMetaObject * | metaObject () const |
Returns a pointer to the meta-object of this object. More... | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. More... | |
QString | objectName () const |
QObject * | parent () const |
Returns a pointer to the parent object. More... | |
QVariant | property (const char *name) const |
Returns the value of the object's name property. More... | |
Q_INVOKABLE | QObject (QObject *parent=0) |
Constructs an object with parent object parent. More... | |
void | removeEventFilter (QObject *) |
Removes an event filter object obj from this object. More... | |
void | setObjectName (const QString &name) |
void | setParent (QObject *) |
Makes the object a child of parent. More... | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. More... | |
void | setUserData (uint id, QObjectUserData *data) |
bool | signalsBlocked () const |
Returns true if signals are blocked; otherwise returns false. More... | |
int | startTimer (int interval) |
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More... | |
QThread * | thread () const |
Returns the thread in which the object lives. More... | |
QObjectUserData * | userData (uint id) const |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. More... | |
Additional Inherited Members | |
Public Types inherited from QAbstractSocketEngine | |
enum | SocketOption { NonBlockingSocketOption, BroadcastSocketOption, ReceiveBufferSocketOption, SendBufferSocketOption, AddressReusable, BindExclusively, ReceiveOutOfBandData, LowDelayOption, KeepAliveOption, MulticastTtlOption, MulticastLoopbackOption } |
Signals inherited from QObject | |
void | destroyed (QObject *=0) |
This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More... | |
Static Public Functions inherited from QAbstractSocketEngine | |
static QAbstractSocketEngine * | createSocketEngine (QAbstractSocket::SocketType socketType, const QNetworkProxy &, QObject *parent) |
static QAbstractSocketEngine * | createSocketEngine (int socketDescripter, QObject *parent) |
Static Public Functions inherited from QObject | |
static bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More... | |
static bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
Disconnects signal in object sender from method in object receiver. More... | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static uint | registerUserData () |
static QString | tr (const char *sourceText, const char *comment=0, int n=-1) |
static QString | trUtf8 (const char *sourceText, const char *comment=0, int n=-1) |
Static Public Variables inherited from QObject | |
static const QMetaObject | staticMetaObject |
This variable stores the meta-object for the class. More... | |
Protected Functions inherited from QAbstractSocketEngine | |
QAbstractSocketEngine (QAbstractSocketEnginePrivate &dd, QObject *parent=0) | |
void | setError (QAbstractSocket::SocketError error, const QString &errorString) const |
void | setLocalAddress (const QHostAddress &address) |
void | setLocalPort (quint16 port) |
void | setPeerAddress (const QHostAddress &address) |
void | setPeerPort (quint16 port) |
void | setProtocol (QAbstractSocket::NetworkLayerProtocol protocol) |
void | setSocketType (QAbstractSocket::SocketType socketType) |
void | setState (QAbstractSocket::SocketState state) |
Protected Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *) |
This event handler can be reimplemented in a subclass to receive child events. More... | |
virtual void | connectNotify (const char *signal) |
This virtual function is called when something has been connected to signal in this object. More... | |
virtual void | customEvent (QEvent *) |
This event handler can be reimplemented in a subclass to receive custom events. More... | |
virtual void | disconnectNotify (const char *signal) |
This virtual function is called when something has been disconnected from signal in this object. More... | |
QObject (QObjectPrivate &dd, QObject *parent=0) | |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. More... | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More... | |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *) |
This event handler can be reimplemented in a subclass to receive timer events for the object. More... | |
Protected Variables inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Static Protected Variables inherited from QObject | |
static const QMetaObject | staticQtMetaObject |
Related Functions inherited from QObject | |
T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QRegExp ®Exp)() |
T * | qobject_cast (QObject *object) |
QObjectList | |
void * | qt_find_obj_child (QObject *parent, const char *type, const QString &name) |
Returns a pointer to the object named name that inherits type and with a given parent. More... | |
The QNativeSocketEngine class provides low level access to a socket.
QtSocketLayer provides basic socket functionality provided by the operating system. It also keeps track of what state the socket is in, and which errors that occur.
The classes QTcpSocket, QUdpSocket and QTcpServer provide a higher level API, and are in general more useful for the common application.
There are two main ways of initializing the a QNativeSocketEngine; either create a new socket by passing the socket type (TcpSocket or UdpSocket) and network layer protocol (IPv4Protocol or IPv6Protocol) to initialize(), or pass an existing socket descriptor and have QNativeSocketEngine determine the type and protocol itself. The native socket descriptor can later be fetched by calling socketDescriptor(). The socket is made non-blocking, but blocking behavior can still be achieved by calling waitForRead() and waitForWrite(). isValid() can be called to check if the socket has been successfully initialized and is ready to use.
To connect to a host, determine its address and pass this and the port number to connectToHost(). The socket can then be used as a TCP or UDP client. Otherwise; bind(), listen() and accept() are used to have the socket function as a TCP or UDP server. Call close() to close the socket.
bytesAvailable() is called to determine how much data is available for reading. read() and write() are used by both TCP and UDP clients to exchange data with the connected peer. UDP clients can also call hasMoreDatagrams(), nextDatagramSize(), readDatagram(), and writeDatagram().
Call state() to determine the state of the socket, for example, ListeningState or ConnectedState. socketType() tells whether the socket is a TCP socket or a UDP socket, or if the socket type is unknown. protocol() is used to determine the socket's network layer protocol.
localAddress(), localPort() are called to find the address and port that are currently bound to the socket. If the socket is connected, peerAddress() and peerPort() determine the address and port of the connected peer.
Finally, if any function should fail, error() and errorString() can be called to determine the cause of the error.
Definition at line 103 of file qnativesocketengine_p.h.
QNativeSocketEngine::QNativeSocketEngine | ( | QObject * | parent = 0 | ) |
Constructs a QNativeSocketEngine.
Definition at line 330 of file qnativesocketengine.cpp.
QNativeSocketEngine::~QNativeSocketEngine | ( | ) |
|
virtual |
Accepts a pending connection from the socket, which must be in ListeningState, and returns its socket descriptor.
If no pending connections are available, -1 is returned.
Implements QAbstractSocketEngine.
Definition at line 654 of file qnativesocketengine.cpp.
|
virtual |
Binds the socket to the address address and port port.
Returns true on success; otherwise false is returned. The port may be 0, in which case an arbitrary unused port is assigned automatically by the operating system.
Servers call this function to set up the server's address and port. TCP servers must in addition call listen() after bind().
Implements QAbstractSocketEngine.
Definition at line 594 of file qnativesocketengine.cpp.
|
virtual |
Returns the number of bytes that are currently available for reading.
On error, -1 is returned.
For UDP sockets, this function returns the accumulated size of all pending datagrams, and it is therefore more useful for UDP sockets to call hasPendingDatagrams() and pendingDatagramSize().
Implements QAbstractSocketEngine.
Definition at line 720 of file qnativesocketengine.cpp.
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 824 of file qnativesocketengine.cpp.
|
virtual |
Closes the socket.
In order to use the socket again, initialize() must be called.
Implements QAbstractSocketEngine.
Definition at line 863 of file qnativesocketengine.cpp.
Referenced by initialize(), read(), and ~QNativeSocketEngine().
|
slot |
If there's a connection activity on the socket, process it.
Then notify our parent if there really was activity.
Definition at line 555 of file qnativesocketengine.cpp.
|
virtual |
Connects to the IP address and port specified by address and port.
If the connection is established, this function returns true and the socket enters ConnectedState. Otherwise, false is returned.
If false is returned, state() should be called to see if the socket is in ConnectingState. If so, a delayed TCP connection is taking place, and connectToHost() must be called again later to determine if the connection was established successfully or not. The second connection attempt must be made when the socket is ready for writing. This state can be determined either by connecting a QSocketNotifier to the socket descriptor returned by socketDescriptor(), or by calling the blocking function waitForWrite().
Example:
Otherwise, error() should be called to determine the cause of the error.
Implements QAbstractSocketEngine.
Definition at line 524 of file qnativesocketengine.cpp.
Referenced by connectionNotification(), waitForRead(), waitForReadOrWrite(), and waitForWrite().
Connects to the remote host name given by name on port port.
When this function is called, the upper-level will not perform a hostname lookup.
The native socket engine does not support this operation, but some other socket engines (notably proxy-based ones) do.
Implements QAbstractSocketEngine.
Definition at line 575 of file qnativesocketengine.cpp.
|
virtual |
Returns true if there is at least one datagram pending.
This function is only called by UDP sockets, where a datagram can have a size of 0. TCP sockets call bytesAvailable().
Implements QAbstractSocketEngine.
Definition at line 734 of file qnativesocketengine.cpp.
|
virtual |
Initializes a QNativeSocketEngine by creating a new socket of type socketType and network layer protocol protocol.
Returns true on success; otherwise returns false.
If the socket was already initialized, this function closes the socket before reeinitializing it.
The new socket is non-blocking, and for UDP sockets it's also broadcast enabled.
Implements QAbstractSocketEngine.
Definition at line 354 of file qnativesocketengine.cpp.
|
virtual |
Initializes the socket using socketDescriptor instead of creating a new one.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The socket type and network layer protocol are determined automatically. The socket's state is set to socketState.
If the socket type is either TCP or UDP, it is made non-blocking. UDP sockets are also broadcast enabled.
Implements QAbstractSocketEngine.
Definition at line 439 of file qnativesocketengine.cpp.
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 1256 of file qnativesocketengine.cpp.
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 1136 of file qnativesocketengine.cpp.
|
virtual |
Returns true if the socket is valid; otherwise returns false.
A socket is valid if it has not been successfully initialized, or if it has been closed.
Implements QAbstractSocketEngine.
Definition at line 486 of file qnativesocketengine.cpp.
Referenced by initialize().
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 1239 of file qnativesocketengine.cpp.
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 669 of file qnativesocketengine.cpp.
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 682 of file qnativesocketengine.cpp.
|
virtual |
Prepares a TCP server for accepting incoming connections.
This function must be called after bind(), and only by TCP sockets.
After this function has been called, pending client connections are detected by checking if the socket is ready for reading. This can be done by either creating a QSocketNotifier, passing the socket descriptor returned by socketDescriptor(), or by calling the blocking function waitForRead().
Example:
Implements QAbstractSocketEngine.
Definition at line 633 of file qnativesocketengine.cpp.
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 693 of file qnativesocketengine.cpp.
|
virtual |
Returns the value of the option socketOption.
Implements QAbstractSocketEngine.
Definition at line 1130 of file qnativesocketengine.cpp.
Referenced by receiveBufferSize(), and sendBufferSize().
|
virtual |
Returns the size of the pending datagram, or -1 if no datagram is pending.
A datagram size of 0 is perfectly valid. This function is called by UDP sockets before receiveMessage(). For TCP sockets, call bytesAvailable().
Implements QAbstractSocketEngine.
Definition at line 750 of file qnativesocketengine.cpp.
Reads up to maxSize bytes into data from the socket.
Returns the number of bytes read, or -1 if an error occurred.
Implements QAbstractSocketEngine.
Definition at line 833 of file qnativesocketengine.cpp.
|
virtual |
Reads up to maxSize bytes of a datagram from the socket, stores it in data and returns the number of bytes read.
The address and port of the sender are stored in address and port. If either of these pointers is 0, the corresponding value is discarded.
To avoid unnecessarily loss of data, call pendingDatagramSize() to determine the size of the pending message before reading it. If maxSize is too small, the rest of the datagram will be lost.
Returns -1 if an error occurred.
Implements QAbstractSocketEngine.
Definition at line 774 of file qnativesocketengine.cpp.
qint64 QNativeSocketEngine::receiveBufferSize | ( | ) | const |
Returns the size of the operating system's socket receive buffer.
Depending on the operating system, this size may be different from what has been set earlier with setReceiveBufferSize().
Definition at line 1064 of file qnativesocketengine.cpp.
qint64 QNativeSocketEngine::sendBufferSize | ( | ) | const |
Returns the size of the operating system send buffer.
Depending on the operating system, this size may be different from what has been set earlier with setSendBufferSize().
Definition at line 1096 of file qnativesocketengine.cpp.
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 1262 of file qnativesocketengine.cpp.
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 702 of file qnativesocketengine.cpp.
|
virtual |
Sets the option option to the value value.
Implements QAbstractSocketEngine.
Definition at line 1121 of file qnativesocketengine.cpp.
Referenced by initialize(), setReceiveBufferSize(), and setSendBufferSize().
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 1228 of file qnativesocketengine.cpp.
void QNativeSocketEngine::setReceiveBufferSize | ( | qint64 | size | ) |
Sets the size of the operating system receive buffer to size.
For clients, this should be set before connectToHost() is called; otherwise it will have no effect. For servers, it should be called before listen().
The operating system receive buffer size effectively limits two things: how much data can be in transit at any one moment, and how much data can be received in one iteration of the main event loop. Setting the size of the receive buffer may have an impact on the socket's performance.
The default value is operating system-dependent.
Definition at line 1085 of file qnativesocketengine.cpp.
void QNativeSocketEngine::setSendBufferSize | ( | qint64 | size | ) |
Sets the size of the operating system send buffer to size.
The operating system send buffer size effectively limits how much data can be in transit at any one moment. Setting the size of the send buffer may have an impact on the socket's performance.
The default value is operating system-dependent.
Definition at line 1111 of file qnativesocketengine.cpp.
Referenced by sendBufferSize().
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 1245 of file qnativesocketengine.cpp.
|
virtual |
Returns the native socket descriptor.
Any use of this descriptor stands the risk of being non-portable.
Implements QAbstractSocketEngine.
Definition at line 496 of file qnativesocketengine.cpp.
Referenced by initialize().
|
virtual |
Waits for msecs milliseconds or until the socket is ready for reading.
If timedOut is not 0 and msecs milliseconds have passed, the value of timedOut is set to true.
Returns true if data is available for reading; otherwise returns false.
This is a blocking function call; its use is disadvised in a single threaded application, as the whole thread will stop responding until the function returns. waitForRead() is most useful when there is no event loop available. The general approach is to create a QSocketNotifier, passing the socket descriptor returned by socketDescriptor() to its constructor.
Implements QAbstractSocketEngine.
Definition at line 912 of file qnativesocketengine.cpp.
|
virtual |
Implements QAbstractSocketEngine.
Definition at line 1006 of file qnativesocketengine.cpp.
|
virtual |
Waits for msecs milliseconds or until the socket is ready for writing.
If timedOut is not 0 and msecs milliseconds have passed, the value of timedOut is set to true.
Returns true if data is available for writing; otherwise returns false.
This is a blocking function call; its use is disadvised in a single threaded application, as the whole thread will stop responding until the function returns. waitForWrite() is most useful when there is no event loop available. The general approach is to create a QSocketNotifier, passing the socket descriptor returned by socketDescriptor() to its constructor.
Implements QAbstractSocketEngine.
Definition at line 952 of file qnativesocketengine.cpp.
Referenced by waitForReadOrWrite().
Writes a block of size bytes from data to the socket.
Returns the number of bytes written, or -1 if an error occurred.
Implements QAbstractSocketEngine.
Definition at line 815 of file qnativesocketengine.cpp.
|
virtual |
Writes a UDP datagram of size size bytes to the socket from data to the address host on port port, and returns the number of bytes written, or -1 if an error occurred.
Only one datagram is sent, and if there is too much data to fit into a single datagram, the operation will fail and error() will return QAbstractSocket::DatagramTooLargeError. Operating systems impose an upper limit to the size of a datagram, but this size is different on almost all platforms. Sending large datagrams is in general disadvised, as even if they are sent successfully, they are likely to be fragmented before arriving at their destination.
Experience has shown that it is in general safe to send datagrams no larger than 512 bytes.
Implements QAbstractSocketEngine.
Definition at line 802 of file qnativesocketengine.cpp.