21 #ifndef BT_SERVERINTERFACE_H
22 #define BT_SERVERINTERFACE_H
25 #include <QStringList>
26 #include <ktorrent_export.h>
27 #include <util/constants.h>
28 #include <mse/encryptedpacketsocket.h>
39 class KTORRENT_EXPORT ServerInterface :
public QObject
43 ServerInterface(QObject* parent = 0);
44 ~ServerInterface()
override;
51 virtual bool changePort(Uint16 port) = 0;
54 static void setPort(Uint16 p) {port = p;}
57 static Uint16 getPort() {
return port;}
92 static void enableEncryption(
bool allow_unencrypted);
97 static void disableEncryption();
99 static bool isEncryptionEnabled() {
return encryption;}
100 static bool unencryptedConnectionsAllowed() {
return allow_unencrypted;}
105 static QStringList bindAddresses();
107 static void setUtpEnabled(
bool on,
bool only_use_utp);
108 static bool isUtpEnabled() {
return utp_enabled;}
109 static bool onlyUseUtp() {
return only_use_utp;}
110 static void setPrimaryTransportProtocol(TransportProtocol proto);
111 static TransportProtocol primaryTransportProtocol() {
return primary_transport_protocol;}
114 void newConnection(mse::EncryptedPacketSocket::Ptr sock);
118 static QList<PeerManager*> peer_managers;
119 static bool encryption;
120 static bool allow_unencrypted;
121 static bool utp_enabled;
122 static bool only_use_utp;
123 static TransportProtocol primary_transport_protocol;
128 #endif // BT_SERVERINTERFACE_H