Browse Source

Merge pull request #1005 from tomDev5/feature/listen-endpoint-getter

add a getter method for TCP listen_endpoint
Dario Nieuwenhuis 5 months ago
parent
commit
e9b66eadae
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/socket/tcp.rs

+ 6 - 0
src/socket/tcp.rs

@@ -793,6 +793,12 @@ impl<'a> Socket<'a> {
         self.hop_limit = hop_limit
     }
 
+    /// Return the listen endpoint
+    #[inline]
+    pub fn listen_endpoint(&self) -> IpListenEndpoint {
+        self.listen_endpoint
+    }
+
     /// Return the local endpoint, or None if not connected.
     #[inline]
     pub fn local_endpoint(&self) -> Option<IpEndpoint> {