Interface ListeningPort

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
PortForwarder

public interface ListeningPort extends Closeable
Represents a listening port that forwards a connection via port forwarding.
Author:
Kohsuke Kawaguchi
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Shuts down the port forwarding by removing the server socket.
    int
    TCP/IP port that is listening.
  • Method Details

    • getPort

      int getPort()
      TCP/IP port that is listening.
    • close

      void close() throws IOException
      Shuts down the port forwarding by removing the server socket. Connections that are already established will not be affected by this operation.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException