Package net.ME1312.SubData.Client
Class DataClient
java.lang.Object
net.ME1312.SubData.Client.DataClient
- All Implemented Interfaces:
DataSender
SubData Client API Class
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()Closes the connectionabstract voidforwardMessage(UUID id, MessageOut... messages) Forward a message to another Clientabstract InetSocketAddressGet Remote Addressabstract intGet SubData's default Block Sizeabstract voidGrabs a Client from the Networkabstract voidGrabs all the Clients on the NetworkDeprecated.The Client connection to the Server is thisgetID()Get the ID of this Clientabstract DataProtocolGet the Protocol for this Clientabstract booleanisClosed()Get if the connection has been closedabstract DataClientOpen an Async Data SubChannelabstract voidping(Consumer<PingResponse> response) Ping the Serverabstract voidping(UUID id, Consumer<PingResponse> response) Ping a remote Clientabstract voidsendMessage(MessageOut... messages) Send a message to the Serverabstract voidtempBlockSize(Integer size) Set SubData's Block Size for the current messagevoidwaitFor()Wait for the connection to close
-
Field Details
-
on
-
-
Constructor Details
-
DataClient
public DataClient()
-
-
Method Details
-
getClient
Grabs a Client from the Network- Parameters:
id- Client ID
-
getClients
Grabs all the Clients on the Network -
ping
Ping the Server- Specified by:
pingin interfaceDataSender- Parameters:
response- Ping Response
-
ping
Ping a remote Client- Parameters:
id- Client IDresponse- Ping Response
-
sendMessage
Send a message to the Server- Specified by:
sendMessagein interfaceDataSender- Parameters:
messages- Messages to send- See Also:
-
forwardMessage
Forward a message to another Client- Parameters:
id- Client IDmessages- Messages to send- See Also:
-
getBlockSize
public abstract int getBlockSize()Get SubData's default Block Size- Returns:
- Block Size
-
tempBlockSize
Set SubData's Block Size for the current message- Parameters:
size- Block Size (null for default)
-
getConnection
Deprecated.The Client connection to the Server is thisGet the Client that connects the Server to us- Specified by:
getConnectionin interfaceDataSender- Returns:
- This Client
-
getProtocol
Get the Protocol for this Client- Specified by:
getProtocolin interfaceDataSender- Returns:
- Client Protocol
-
getID
Get the ID of this Client- Specified by:
getIDin interfaceDataSender- Returns:
- Client ID
-
getAddress
Get Remote Address- Returns:
- Address
-
newChannel
Open an Async Data SubChannel- Returns:
- New SubData Channel
- Throws:
IOException
-
close
Closes the connection- Throws:
IOException
-
waitFor
Wait for the connection to close- Throws:
InterruptedException
-
isClosed
public abstract boolean isClosed()Get if the connection has been closed- Returns:
- Closed Status
-