src/eric7/RemoteServerInterface/EricServerInterface.py

branch
server
changeset 10723
88bec462b855
parent 10630
552a790fd9bc
child 10762
d141283f7334
diff -r b74d46513011 -r 88bec462b855 src/eric7/RemoteServerInterface/EricServerInterface.py
--- a/src/eric7/RemoteServerInterface/EricServerInterface.py	Tue May 21 17:29:42 2024 +0200
+++ b/src/eric7/RemoteServerInterface/EricServerInterface.py	Tue May 21 19:31:08 2024 +0200
@@ -240,6 +240,19 @@
         self.__connection = None
         self.__callbacks.clear()
 
+    def getHost(self):
+        """
+        Public method to get the connected host as "host name:port".
+
+        @return connected host as "host name:port" or an empty string, if there is no
+            valid connection
+        @rtype str
+        """
+        if self.isServerConnected():
+            return f"{self.__connection.peerName()}:{self.__connection.peerPort()}"
+        else:
+            return ""
+
     #######################################################################
     ## Methods for sending requests and receiving the replies.
     #######################################################################

eric ide

mercurial