public final class TransportPacketFactoryImpl extends Object implements TransportPacketFactory
| Constructor and Description |
|---|
TransportPacketFactoryImpl(PacketFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
TransportPacket |
create(Protocol protocol,
byte[] srcAddress,
int srcPort,
byte[] destAddress,
int destPort,
Buffer payload)
Create a new
TransportPacket. |
TransportPacket |
create(Protocol protocol,
String srcAddress,
int srcPort,
String destAddress,
int destPort,
Buffer payload)
Create a new
TransportPacket. |
UDPPacket |
createUDP(Buffer payload) |
UDPPacket |
createUDP(long ts,
Buffer payload)
Create a
UDPPacket with the specified payload and with the
following default values:
MAC Src Address: 00:00:00:00:00:00
MAC Dst Address: 00:00:00:00:00:00
IP Src Address: 127.0.0.1
IP Dst Address: 127.0.0.1
UDP Src Port: 0
UDP Dst Port: 0
|
public TransportPacketFactoryImpl(PacketFactory factory)
public TransportPacket create(Protocol protocol, String srcAddress, int srcPort, String destAddress, int destPort, Buffer payload) throws IllegalArgumentException, IllegalProtocolException
TransportPacket.create in interface TransportPacketFactoryprotocol - which protocol, currently only Protocol.UDP and
Protocol.TCP are supportedsrcAddress - the source address.srcPort - the source portdestAddress - the destination addressdestPort - the destination portpayload - the payload or null if noneTransportPacketIllegalArgumentExceptionIllegalProtocolExceptionpublic TransportPacket create(Protocol protocol, byte[] srcAddress, int srcPort, byte[] destAddress, int destPort, Buffer payload) throws IllegalArgumentException, IllegalProtocolException
TransportPacketFactoryTransportPacket.create in interface TransportPacketFactoryprotocol - which protocol, currently only Protocol.UDP and
Protocol.TCP are supportedsrcAddress - the source address.srcPort - the source portdestAddress - the destination addressdestPort - the destination portpayload - the payload or null if noneTransportPacketIllegalArgumentExceptionIllegalProtocolExceptionpublic UDPPacket createUDP(long ts, Buffer payload) throws IllegalArgumentException, IllegalProtocolException
TransportPacketFactoryUDPPacket with the specified payload and with the
following default values:
createUDP in interface TransportPacketFactoryIllegalArgumentExceptionIllegalProtocolExceptionpublic UDPPacket createUDP(Buffer payload) throws IllegalArgumentException, IllegalProtocolException
createUDP in interface TransportPacketFactoryIllegalArgumentExceptionIllegalProtocolExceptionCopyright © 2021. All Rights Reserved.