public final class TCPServer extends Server
| Constructor and Description |
|---|
TCPServer()
Initialize a default client that
will connect to local server at
default port 49305
|
TCPServer(int port)
Initialize a client with a custom port
that will connect to the specified server at the
specified port
|
TCPServer(String host,
int port)
Initialize a client that will connect
to the specified server at specified port
|
| Modifier and Type | Method and Description |
|---|---|
void |
ban(String... address)
Ban an address from the server
|
void |
broadcast(byte[] data)
Send a message to each connected client
|
void |
close()
Close the connection
|
Server |
debug(boolean status)
Set the client debug status
|
Set<RemoteClient> |
getClients()
Get the connected clients
|
String |
getMAC()
Get the server MAC address
|
WorkLevel |
getWorkLevel()
Get the client work level
|
void |
kick(String... address)
Kick an address from the server
|
void |
redirect(String name,
byte[] data)
Redirect a message to the specified client
|
CompletableFuture<Boolean> |
start()
Try to start the server
|
void |
unBan(String... address)
Unban an address from the server
|
public TCPServer()
public TCPServer(int port)
port - the server portpublic TCPServer(String host, int port)
host - the serverport - the server portpublic Server debug(boolean status)
public CompletableFuture<Boolean> start()
public String getMAC()
public Set<RemoteClient> getClients()
getClients in class Serverpublic WorkLevel getWorkLevel()
getWorkLevel in class Serverpublic void broadcast(byte[] data)
public void redirect(String name, byte[] data)
public void ban(String... address)
public void kick(String... address)
Copyright © 2021. All rights reserved.