- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions

# QUdpSocket Class Reference

Search for all occurrences

## Detailed Description

Definition at line 58 of file qudpsocket.h.

`#include <qudpsocket.h>`

Inheritance diagram for QUdpSocket:
[legend]

List of all members.

## Public Types
enum | BindFlag { DefaultForPlatform = 0x0, ShareAddress = 0x1, DontShareAddress = 0x2, ReuseAddressHint = 0x4 }
## Public Member Functions
| QUdpSocket (QObject *parent=0)
virtual | ~QUdpSocket ()
bool | bind (const QHostAddress &address, quint16 port)
bool | bind (quint16 port=0)
bool | bind (const QHostAddress &address, quint16 port, BindMode mode)
bool | bind (quint16 port, BindMode mode)
bool | hasPendingDatagrams () const
qint64 | pendingDatagramSize () const
qint64 | readDatagram (char *data, qint64 maxlen, QHostAddress *host=0, quint16 *port=0)
qint64 | writeDatagram (const char *data, qint64 len, const QHostAddress &host, quint16 port)
qint64 | writeDatagram (const QByteArray &datagram, const QHostAddress &host, quint16 port)

## Member Enumeration Documentation

enum BindFlag

Search for all occurrences

Enumerator:

  DefaultForPlatform | Search for all occurrences
  ShareAddress | Search for all occurrences
  DontShareAddress | Search for all occurrences
  ReuseAddressHint | Search for all occurrences

Definition at line 62 of file qudpsocket.h.

                      {
            DefaultForPlatform = 0x0,
            ShareAddress = 0x1,
            DontShareAddress = 0x2,
            ReuseAddressHint = 0x4
        };

## Constructor & Destructor Documentation

QUdpSocket | ( | QObject * | parent = `0` | ) | `[explicit]`

virtual ~QUdpSocket | ( |  | ) | `[virtual]`

## Member Function Documentation

bool bind | ( | const QHostAddress & | address,
|  | quint16 | port
| ) |  |

Search for all occurrences

bool bind | ( | quint16 | port = `0` | ) |

Search for all occurrences

bool bind | ( | const QHostAddress & | address,
|  | quint16 | port,
|  | BindMode | mode
| ) |  |

Search for all occurrences

bool bind | ( | quint16 | port,
|  | BindMode | mode
| ) |  |

Search for all occurrences

bool hasPendingDatagrams | ( |  | ) | const

Search for all occurrences

qint64 pendingDatagramSize | ( |  | ) | const

Search for all occurrences

qint64 readDatagram | ( | char * | data,
|  | qint64 | maxlen,
|  | QHostAddress * | host = `0`,
|  | quint16 * | port = `0`
| ) |  |

Search for all occurrences

qint64 writeDatagram | ( | const char * | data,
|  | qint64 | len,
|  | const QHostAddress & | host,
|  | quint16 | port
| ) |  |

Search for all occurrences

qint64 writeDatagram | ( | const QByteArray & | datagram,
|  | const QHostAddress & | host,
|  | quint16 | port
| ) |  | `[inline]`

Search for all occurrences

Definition at line 83 of file qudpsocket.h.

            { return writeDatagram(datagram.constData(), datagram.size(), host, port); }

The documentation for this class was generated from the following file:

- QtNetwork/qudpsocket.h

QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket
QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket QUdpSocket