Interface PacketSender
- All Known Subinterfaces:
NetworkChannel, NetworkClient, NetworkComponent, NetworkServer
public interface PacketSender
Represents a source of packets which is connected to a specific target.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidsendPacket(@NonNull Packet packet) Sends the given packet to the associated target.default voidsendPacket(@NonNull Packet... packets) Sends all the given packets to the associated target.voidsendPacketSync(@NonNull Packet packet) Sends the given packet to the associated target, waiting for the packet write to the channel to complete before resuming the current thread.
-
Method Details
-
sendPacket
Sends the given packet to the associated target.- Parameters:
packet- the packet to send.- Throws:
NullPointerException- if the packet is null.
-
sendPacketSync
Sends the given packet to the associated target, waiting for the packet write to the channel to complete before resuming the current thread.- Parameters:
packet- the packet to send.- Throws:
NullPointerException- if the given packet is null.
-
sendPacket
Sends all the given packets to the associated target.- Parameters:
packets- the packets to send.- Throws:
NullPointerException- if the packets are null.
-