public class PacketWriter extends Object
| Constructor and Description |
|---|
PacketWriter(int maxPacketSize)
Create a PacketWriter with an expected max packet size.
|
| Modifier and Type | Method and Description |
|---|---|
long |
currentPacketId()
Return the currentPacketId.
|
List<Packet> |
write(boolean requiresAck,
List<? extends Message> messages)
Create Packets for a given list of messages.
|
List<Packet> |
write(RemoteTransactionEvent transEvent)
Create Packets for a given RemoteTransactionEvent.
|
public PacketWriter(int maxPacketSize)
In theory we would prefer to create packets up to the MTU size which for Ethernet will likely be 1500. Note that the maxPacketSize is ignored for large single messages.
public long currentPacketId()
public List<Packet> write(boolean requiresAck, List<? extends Message> messages) throws IOException
Typically this creates a single Packet but there is a hard limit for UDP packet sizes.
IOExceptionpublic List<Packet> write(RemoteTransactionEvent transEvent) throws IOException
Typically this creates a single Packet but there is a hard limit for UDP packet sizes.
IOExceptionCopyright © 2014. All Rights Reserved.