#include <serversocket.h>
Convenience class to create and bind a server socket. Internally it combines a QSocketNotifier and a net::Socket.
Definition at line 41 of file serversocket.h.
◆ ServerSocket() [1/2]
Create a TCP server socket
- Parameters
-
chandler | The connection handler |
◆ ServerSocket() [2/2]
net::ServerSocket::ServerSocket |
( |
DataHandler * |
dhandler | ) |
|
Create an UDP server socket
- Parameters
-
◆ bind() [1/2]
Bind the socket to an address
- Parameters
-
- Returns
- true upon success, false otherwise
◆ bind() [2/2]
bool net::ServerSocket::bind |
( |
const QString & |
ip, |
|
|
bt::Uint16 |
port |
|
) |
| |
Bind the socket to an IP and port
- Parameters
-
ip | The IP address |
port | The port number |
- Returns
- true upon success, false otherwise
◆ sendTo() [1/2]
int net::ServerSocket::sendTo |
( |
const bt::Uint8 * |
buf, |
|
|
int |
size, |
|
|
const net::Address & |
addr |
|
) |
| |
Method to send data with the socket. Only use this when the socket is a UDP socket. It will fail for TCP server sockets.
- Parameters
-
buf | The data to send |
size | The size of the data |
addr | The address to send to |
- Returns
- The number of bytes sent
◆ sendTo() [2/2]
int net::ServerSocket::sendTo |
( |
const QByteArray & |
data, |
|
|
const net::Address & |
addr |
|
) |
| |
Method to send data with the socket. Only use this when the socket is a UDP socket. It will fail for TCP server sockets.
- Parameters
-
data | The data to send |
addr | The address to send to |
- Returns
- The number of bytes sent
◆ setReadNotificationsEnabled()
void net::ServerSocket::setReadNotificationsEnabled |
( |
bool |
on | ) |
|
Enable read notifications.
- Parameters
-
◆ setTOS()
bool net::ServerSocket::setTOS |
( |
unsigned char |
type_of_service | ) |
|
Set the TOS byte of the socket
- Parameters
-
type_of_service | Value to set |
- Returns
- true upon success, false otherwise
◆ setWriteNotificationsEnabled()
void net::ServerSocket::setWriteNotificationsEnabled |
( |
bool |
on | ) |
|
Enable write notifications.
- Parameters
-
The documentation for this class was generated from the following file: