21 #ifndef UTP_UTPSERVER_H
22 #define UTP_UTPSERVER_H
25 #include <interfaces/serverinterface.h>
26 #include <net/address.h>
28 #include <utp/connection.h>
68 void setTOS(bt::Uint8 type_of_service);
80 virtual void handlePacket(bt::Buffer::Ptr buffer,
const net::Address & addr);
81 void stateChanged(Connection::Ptr conn,
bool readable,
bool writeable)
override;
82 void closed(Connection::Ptr conn)
override;
83 void customEvent(QEvent* ev)
override;
86 void handlePendingConnectionsDelayed();
101 #endif // UTP_UTPSERVER_H
Connection::WPtr connectTo(const net::Address &addr)
Setup a connection to a remote address.
void setCreateSockets(bool on)
Enabled creating sockets (tests need to have this disabled)
void accepted()
Emitted when a connection is accepted if creating sockets is disabled.
Connection::WPtr acceptedConnection()
Get the last accepted connection (Note: for unittest purposes)
void start()
Start the UTP server.
void stop()
Stop the UTP server.
bool changePort(bt::Uint16 port) override
bool sendTo(Connection::Ptr conn, const PacketBuffer &packet) override
Send a packet to some host.
void handlePendingConnections()
void setTOS(bt::Uint8 type_of_service)
Set the TOS byte.
void threadStarted()
Thread has been started.
void stateChanged(Connection::Ptr conn, bool readable, bool writeable) override
Connection has become readable, writeable or both.
void closed(Connection::Ptr conn) override
Called when the connection is closed.
void preparePolling(net::Poll *p, net::Poll::Mode mode, Connection::Ptr &conn)
Prepare the server for polling.