Package hudson.slaves

Class ChannelPinger

All Implemented Interfaces:

@Extension public class ChannelPinger extends ComputerListener
Establish a periodic ping to keep connections between agents and the main Jenkins node alive. This prevents network proxies from terminating connections that are idle for too long.
  • Constructor Details

    • ChannelPinger

      public ChannelPinger()
  • Method Details

    • preOnline

      public void preOnline(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener)
      Description copied from class: ComputerListener
      Called before a Computer is marked online.

      This enables you to do some work on all the agents as they get connected. Unlike ComputerListener.onOnline(Computer, TaskListener), a failure to carry out this function normally will prevent a computer from marked as online.

      preOnline in class ComputerListener
      channel - This is the channel object to talk to the agent. (This is the same object returned by Computer.getChannel() once it's connected.
      root - The directory where this agent stores files. The same as Node.getRootPath(), except that method returns null until the agent is connected. So this parameter is passed explicitly instead.
      listener - This is connected to the launch log of the computer. Since this method is called synchronously from the thread that launches a computer, if this method performs a time-consuming operation, this listener should be notified of the progress. This is also a good listener for reporting problems.
      See Also:
    • install

      public void install(hudson.remoting.Channel channel)
    • setUpPingForChannel

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void setUpPingForChannel(hudson.remoting.Channel channel, SlaveComputer computer, int timeoutSeconds, int intervalSeconds, boolean analysis)