@StaplerAccessibleType public final class TcpSlaveAgentListener extends Thread
Aside from the HTTP endpoint, Jenkins runs TcpSlaveAgentListener
that listens on a TCP socket.
Historically this was used for inbound connection from 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.
AgentProtocol
Modifier and Type | Class and Description |
---|---|
static class |
TcpSlaveAgentListener.ConnectionFromCurrentPeer
Connection terminated because we are reconnected from the current peer.
|
static class |
TcpSlaveAgentListener.PingAgentProtocol
This extension provides a Ping protocol that allows people to verify that the TcpSlaveAgentListener is alive.
|
static class |
TcpSlaveAgentListener.TcpSlaveAgentListenerRescheduler
Reschedules the
TcpSlaveAgentListener on demand. |
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
static String |
CLI_HOST_NAME
Host name that we advertise protocol clients to connect to.
|
static Integer |
CLI_PORT
Port number that we advertise protocol clients to connect to.
|
int |
configuredPort |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
TcpSlaveAgentListener(int port) |
Modifier and Type | Method and Description |
---|---|
String |
getAdvertisedHost()
Gets the host name that we advertise protocol clients to connect to.
|
int |
getAdvertisedPort()
Gets the TCP port number in which we are advertising.
|
String |
getAgentProtocolNames()
Returns a comma separated list of the enabled
AgentProtocol.getName() implementations so that
clients can avoid creating additional work for the server attempting to connect with unsupported protocols. |
String |
getIdentityPublicKey()
Gets the Base64 encoded public key that forms part of this instance's identity keypair.
|
int |
getPort()
Gets the TCP port number in which we are listening.
|
VersionNumber |
getRemotingMinimumVersion()
Gets Remoting minimum supported version to prevent unsupported agents from connecting
|
void |
run() |
void |
shutdown()
Initiates the shuts down of the listener.
|
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
public final int configuredPort
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static String CLI_HOST_NAME
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static Integer CLI_PORT
getPort()
public TcpSlaveAgentListener(int port) throws IOException
port
- Use 0 to choose a random port.IOException
public int getPort()
public int getAdvertisedPort()
public String getAdvertisedHost()
@Nullable public String getIdentityPublicKey()
public String getAgentProtocolNames()
AgentProtocol.getName()
implementations so that
clients can avoid creating additional work for the server attempting to connect with unsupported protocols.AgentProtocol.getName()
implementationspublic VersionNumber getRemotingMinimumVersion()
public void shutdown()
Copyright © 2004–2021. All rights reserved.