I am writing a server/client code with PyQt5 sockets and I met a strange behavior First, I derived a class from QTCPSocket, so that I abstract the usage of socket to my data frame, use encryption,..etc before sending the data So, let this class = mySocket which is an inherited class from QTCPSocket
mySocket has some variables in its init, Ex: self.key. And as I do in all sockets, I connected its readyread signal to my slot of name: rxdata
Now, the problem. inside rxdata, when I try to get the sender object ( using self.sender() ), what it returns is object of type QTCPSocket not as I was expecting a mySocket object. Which I don't understand
I tried to cast the QTCPsocket returned using qtcpsocketObj.class =mySocket but the problem now, is mySocket.init() obviously not called, this the variables like self.key won't be defined.
What can I do to overcome this issue?