Package org.jline.builtins.telnet
Class PortListener
java.lang.Object
org.jline.builtins.telnet.PortListener
- All Implemented Interfaces:
Runnable
Class that implements a PortListener.
If available, it accepts incoming connections and passes them to an associated ConnectionManager.
If available, it accepts incoming connections and passes them to an associated ConnectionManager.
- Version:
- 2.0 (16/07/2006)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private ConnectionManager
private int
private String
private static final Logger
private static final String
private String
private int
private ServerSocket
private boolean
private Thread
-
Constructor Summary
ConstructorsConstructorDescriptionPortListener
(String name, String ip, int port, int floodprot) Constructs a PortListener instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns reference to ConnectionManager instance associated with the PortListener.getName()
Returns the name of this PortListener.boolean
Tests if this PortListener is available.void
run()
Listen constantly to a server socket and handles incoming connections through the associated {a:link ConnectionManager}.void
setAvailable
(boolean b) Sets the availability flag of this PortListener.void
setConnectionManager
(ConnectionManager connectionManager) void
start()
Starts this PortListener.void
stop()
Stops this PortListener, and returns when everything was stopped successfully.
-
Field Details
-
LOG
-
logmsg
- See Also:
-
name
-
ip
-
port
private int port -
floodProtection
private int floodProtection -
serverSocket
-
thread
-
connectionManager
-
stopping
private boolean stopping -
available
private boolean available
-
-
Constructor Details
-
PortListener
Constructs a PortListener instance.- Parameters:
name
- the nameip
- the ip address to bind toport
- int that specifies the port number of the server socket.floodprot
- that specifies the server socket queue size.
-
-
Method Details
-
getName
Returns the name of this PortListener.- Returns:
- the name as String.
-
isAvailable
public boolean isAvailable()Tests if this PortListener is available.- Returns:
- true if available, false otherwise.
-
setAvailable
public void setAvailable(boolean b) Sets the availability flag of this PortListener.- Parameters:
b
- true if to be available, false otherwise.
-
start
public void start()Starts this PortListener. -
stop
public void stop()Stops this PortListener, and returns when everything was stopped successfully. -
run
public void run()Listen constantly to a server socket and handles incoming connections through the associated {a:link ConnectionManager}. -
getConnectionManager
Returns reference to ConnectionManager instance associated with the PortListener.- Returns:
- the associated ConnectionManager.
-
setConnectionManager
-