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 |
|---|---|
String[] |
authors()
Karma source authors
|
void |
close()
Close the connection
|
ml.karmaconfigs.api.common.timer.scheduler.LateScheduler<Boolean> |
connect()
Try to connect to the server
|
ml.karmaconfigs.api.common.timer.scheduler.LateScheduler<Boolean> |
connect(String accessKey)
Try to connect to the server
|
Client |
debug(boolean status)
Set the client debug status
|
String |
description()
Karma source description
|
InetAddress |
getHost()
Get the client address
|
String |
getMAC()
Get the client MAC address
|
String |
getName()
Get the client name
|
int |
getPort()
Get the client port
|
RemoteServer |
getServer()
Get the connected remote server
|
WorkLevel |
getWorkLevel()
Get the client work level
|
boolean |
isConnected()
Get if the client is completely connected
to the server
|
boolean |
isConnecting()
Get if the client is trying to connect to the
server
|
String |
name()
Karma source name
|
void |
rename(String name)
Rename the client on the server interface
|
void |
send(byte[] data)
Send data to the server
|
boolean |
sendMessage(MessageOutput message)
Send a message to the client
|
String |
updateURL()
Karma source update URL
|
String |
version()
Karma source version
|
toStringpublic 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 ml.karmaconfigs.api.common.timer.scheduler.LateScheduler<Boolean> connect()
public ml.karmaconfigs.api.common.timer.scheduler.LateScheduler<Boolean> connect(String accessKey)
public String getName()
public String getMAC()
public InetAddress getHost()
getHost in class RemoteClientpublic int getPort()
getPort in class RemoteClientpublic boolean sendMessage(MessageOutput message)
sendMessage in class RemoteClientmessage - the message to sendpublic RemoteServer getServer()
public WorkLevel getWorkLevel()
getWorkLevel in class Clientpublic boolean isConnecting()
isConnecting in class Clientpublic boolean isConnected()
isConnected in class Clientpublic void rename(String name)
public void send(byte[] data)
public String name()
public String version()
public String description()
public String[] authors()
public String updateURL()
Copyright © 2022. All rights reserved.