Runnable
public class PortListener extends Object implements Runnable
ConnectionManager
Constructor | Description |
---|---|
PortListener(String name,
int port,
int floodprot) |
Constructs a PortListener instance.
|
Modifier and Type | Method | Description |
---|---|---|
ConnectionManager |
getConnectionManager() |
Returns reference to ConnectionManager instance associated
with the PortListener.
|
String |
getName() |
Returns the name of this PortListener.
|
boolean |
isAvailable() |
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.
|
public PortListener(String name, int port, int floodprot)
name
- the nameport
- int that specifies the port number of the server socket.floodprot
- that specifies the server socket queue size.public String getName()
public boolean isAvailable()
public void setAvailable(boolean b)
b
- true if to be available, false otherwise.public void start()
public void stop()
public void run()
run
in interface Runnable
ConnectionManager
public ConnectionManager getConnectionManager()
public void setConnectionManager(ConnectionManager connectionManager)
Copyright © 2020. All rights reserved.