public final class TCPClient extends Client
| Constructor and Description |
|---|
TCPClient()
Initialize a default client that
will connect to local server at
default port 49305
|
TCPClient(int client_port,
String server_host,
int server_port)
Initialize a client with a custom port
that will connect to the specified server at the
specified port
|
TCPClient(String server_host,
int server_port)
Initialize a client that will connect
to the specified server at specified port
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection
|
CompletableFuture<Boolean> |
connect()
Try to connect to the server
|
Client |
debug(boolean status)
Set the client debug status
|
String |
getMAC()
Get the client MAC address
|
String |
getName()
Get the client name
|
RemoteServer |
getServer()
Get the connected remote server
|
WorkLevel |
getWorkLevel()
Get the client work level
|
void |
rename(String name)
Rename the client on the server interface
|
void |
send(byte[] data)
Send data to the server
|
public TCPClient()
public TCPClient(String server_host, int server_port)
server_host - the serverserver_port - the server portpublic TCPClient(int client_port,
String server_host,
int server_port)
client_port - the client portserver_host - the serverserver_port - the server portpublic Client debug(boolean status)
public CompletableFuture<Boolean> connect()
public String getName()
public String getMAC()
public RemoteServer getServer()
public WorkLevel getWorkLevel()
getWorkLevel in class Clientpublic void rename(String name)
public void send(byte[] data)
Copyright © 2021. All rights reserved.