Interface NetworkClient
- All Superinterfaces:
AutoCloseable,NetworkComponent,PacketSender
Represents a network component which can be connected to any network server.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionconnect(@NonNull HostAndPort hostAndPort) Connects this network client to the network server running at the given host and port.Methods inherited from interface java.lang.AutoCloseable
closeMethods inherited from interface eu.cloudnetservice.driver.network.NetworkComponent
channels, closeChannels, firstChannel, packetDispatcher, packetRegistry, sslEnabledMethods inherited from interface eu.cloudnetservice.driver.network.protocol.PacketSender
sendPacket, sendPacket, sendPacketSync
-
Method Details
-
connect
Connects this network client to the network server running at the given host and port.- Parameters:
hostAndPort- the target host and port to which the client should get connected.- Returns:
- a task completed successfully, or with the exception thrown during the connection process.
- Throws:
NullPointerException- if the given host and port is null.
-