250 valid connection |
250 valid connection |
251 @rtype str |
251 @rtype str |
252 """ |
252 """ |
253 if self.isServerConnected(): |
253 if self.isServerConnected(): |
254 return f"{self.__connection.peerName()}:{self.__connection.peerPort()}" |
254 return f"{self.__connection.peerName()}:{self.__connection.peerPort()}" |
|
255 else: |
|
256 return "" |
|
257 |
|
258 def getHostName(self): |
|
259 """ |
|
260 Public method to get the name of the connected host. |
|
261 |
|
262 @return name of the connected host or an empty string, if there is no |
|
263 valid connection |
|
264 @rtype str |
|
265 """ |
|
266 if self.isServerConnected(): |
|
267 return self.__connection.peerName() |
255 else: |
268 else: |
256 return "" |
269 return "" |
257 |
270 |
258 ####################################################################### |
271 ####################################################################### |
259 ## Methods for sending requests and receiving the replies. |
272 ## Methods for sending requests and receiving the replies. |