237 self.__connection.close() |
237 self.__connection.close() |
238 |
238 |
239 self.connectionStateChanged.emit(False) |
239 self.connectionStateChanged.emit(False) |
240 self.__connection = None |
240 self.__connection = None |
241 self.__callbacks.clear() |
241 self.__callbacks.clear() |
|
242 |
|
243 def getHost(self): |
|
244 """ |
|
245 Public method to get the connected host as "host name:port". |
|
246 |
|
247 @return connected host as "host name:port" or an empty string, if there is no |
|
248 valid connection |
|
249 @rtype str |
|
250 """ |
|
251 if self.isServerConnected(): |
|
252 return f"{self.__connection.peerName()}:{self.__connection.peerPort()}" |
|
253 else: |
|
254 return "" |
242 |
255 |
243 ####################################################################### |
256 ####################################################################### |
244 ## Methods for sending requests and receiving the replies. |
257 ## Methods for sending requests and receiving the replies. |
245 ####################################################################### |
258 ####################################################################### |
246 |
259 |