NetSim 1.0.0
An educational network simulation software for students
|
Represents a network port. More...
#include <port.h>
Public Member Functions | |
Port ()=default | |
Default constructor. | |
Port (quint16 portNumber) | |
Constructs a port with a specified port number. | |
quint16 | portNumber () const |
Returns the port number. | |
QVector< quint8 > | toArray () const |
Converts the port number to an array of bytes. | |
bool | operator< (const Port &other) const |
Compares the port number with another port. | |
Static Public Member Functions | |
static Port | getRandomPort () |
Returns a random port. | |
Represents a network port.
This class provides functionalities to represent a network port, which is a 16-bit number commonly used in networking to specify the endpoint in a network address.
|
default |
Default constructor.
|
explicit |
Constructs a port with a specified port number.
|
static |
Returns a random port.
bool Port::operator< | ( | const Port & | other | ) | const |
Compares the port number with another port.
quint16 Port::portNumber | ( | ) | const |
Returns the port number.
QVector< quint8 > Port::toArray | ( | ) | const |
Converts the port number to an array of bytes.