hudson
Class TcpSlaveAgentListener
java.lang.Object
java.lang.Thread
hudson.TcpSlaveAgentListener
- All Implemented Interfaces:
- Runnable
public final class TcpSlaveAgentListener
- extends Thread
Listens to incoming TCP connections from JNLP slave agents and CLI.
Aside from the HTTP endpoint, Jenkins runs TcpSlaveAgentListener
that listens on a TCP socket.
Historically this was used for inbound connection from slave agents (hence the name), but over time
it was extended and made generic, so that multiple protocols of different purposes can co-exist on the
same socket.
This class accepts the socket, then after a short handshaking, it dispatches to appropriate
AgentProtocol
s.
- Author:
- Kohsuke Kawaguchi
- See Also:
AgentProtocol
Method Summary |
int |
getPort()
Gets the TCP port number in which we are listening. |
void |
run()
|
void |
shutdown()
Initiates the shuts down of the listener. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
configuredPort
public final int configuredPort
CLI_HOST_NAME
public static String CLI_HOST_NAME
- Host name that we advertise the CLI client to connect to.
This is primarily for those who have reverse proxies in place such that the HTTP host name
and the CLI TCP/IP connection host names are different.
TODO: think about how to expose this (including whether this needs to be exposed at all.)
TcpSlaveAgentListener
public TcpSlaveAgentListener(int port)
throws IOException
- Parameters:
port
- Use 0 to choose a random port.
- Throws:
IOException
getPort
public int getPort()
- Gets the TCP port number in which we are listening.
run
public void run()
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
shutdown
public void shutdown()
- Initiates the shuts down of the listener.
Copyright © 2004-2013. All Rights Reserved.