20 #ifndef BTAUTHENTICATEBASE_H
21 #define BTAUTHENTICATEBASE_H
25 #include <util/constants.h>
26 #include <mse/encryptedpacketsocket.h>
42 class AuthenticateBase :
public QObject
47 AuthenticateBase(mse::EncryptedPacketSocket::Ptr s);
48 ~AuthenticateBase()
override;
51 void setLocal(
bool loc) {local = loc;}
54 bool isLocal()
const {
return local;}
63 mse::EncryptedPacketSocket::Ptr
getSocket()
const {
return sock;}
83 virtual void onFinish(
bool succes) = 0;
102 void onError(
int err);
105 mse::EncryptedPacketSocket::Ptr sock;
109 Uint32 bytes_of_handshake_received;
void sendHandshake(const SHA1Hash &info_hash, const PeerID &our_peer_id)
virtual void onReadyWrite()
We can write to the socket (used to detect a succesfull connection)
bool isLocal() const
Is this a local peer.
Uint32 supportedExtensions() const
Flags indicating which extensions are supported.
virtual void handshakeReceived(bool full)=0
virtual void onReadyRead()
We can read from the socket.
virtual void onFinish(bool succes)=0
void makeHandshake(bt::Uint8 *buf, const SHA1Hash &info_hash, const PeerID &our_peer_id)
void setLocal(bool loc)
Set whether this is a local peer.
mse::EncryptedPacketSocket::Ptr getSocket() const
get the socket
bool isFinished() const
See if the authentication is finished.