public class NetMarshalServerWrapped extends NetMarshalServer
NetMarshalClient
s, allows stream wrapping.
Wrapped streams should close the underlying stream when closed.
NOTE: Methods that are synchronised are used here, do NOT use instances of these classes as monitors.Constructor and Description |
---|
NetMarshalServerWrapped(java.net.DatagramSocket socketIn,
IPacketFactory factory,
PacketLoader loader,
FragmentationOptions fragmentationOptions,
java.util.function.Function<java.io.InputStream,java.io.InputStream> inputStreamWrapper,
java.util.function.Function<java.io.OutputStream,java.io.OutputStream> outputStreamWrapper)
Constructs a new NetMarshalServerWrapped with the specified
DatagramSocket , IPacketFactory , PacketLoader , FragmentationOptions ,
Function for wrapping the input stream and the Function for wrapping the output stream. |
NetMarshalServerWrapped(java.net.ServerSocket socketIn,
IPacketFactory factory,
PacketLoader loader,
FragmentationOptions fragmentationOptions,
java.util.function.Function<java.io.InputStream,java.io.InputStream> inputStreamWrapper,
java.util.function.Function<java.io.OutputStream,java.io.OutputStream> outputStreamWrapper)
Constructs a new NetMarshalServerWrapped with the specified
ServerSocket , IPacketFactory , PacketLoader , FragmentationOptions ,
Function for wrapping the input stream and the Function for wrapping the output stream. |
Modifier and Type | Method and Description |
---|---|
java.util.function.Function<java.io.InputStream,java.io.InputStream> |
getWrapperInputStream()
Gets the
Function input stream wrapper function. |
java.util.function.Function<java.io.OutputStream,java.io.OutputStream> |
getWrapperOutputStream()
Gets the
Function output stream wrapper function. |
broadcastPacket, close, connect, disconnectAll, flush, getAcceptExceptionBiConsumer, getClientAcceptanceBiConsumer, getClosedConsumer, getConnectedClients, getFragmentationOptions, getOpenedConsumer, getPacketFactory, getPacketLoader, getReceiveBiConsumer, getReceiveExceptionBiConsumer, getSocketSetupBiConsumer, isRunning, localAddress, localPort, open, setAcceptExceptionBiConsumer, setClientAcceptanceBiConsumer, setClosedConsumer, setOpenedConsumer, setReceiveBiConsumer, setReceiveExceptionBiConsumer, setSocketSetupBiConsumer
public NetMarshalServerWrapped(java.net.ServerSocket socketIn, IPacketFactory factory, PacketLoader loader, FragmentationOptions fragmentationOptions, java.util.function.Function<java.io.InputStream,java.io.InputStream> inputStreamWrapper, java.util.function.Function<java.io.OutputStream,java.io.OutputStream> outputStreamWrapper)
ServerSocket
, IPacketFactory
, PacketLoader
, FragmentationOptions
,
Function
for wrapping the input stream and the Function
for wrapping the output stream.socketIn
- The server socket to use.factory
- The packet factory to use.loader
- The packet loader to use.fragmentationOptions
- The fragmentation options, null to disable fragmentation.inputStreamWrapper
- The input stream wrapper to use (Can be null).outputStreamWrapper
- The output stream wrapper to use (Can be null).java.lang.NullPointerException
- socketIn, factory or loader is null.java.lang.IllegalArgumentException
- Fragmentation options failed validation.public NetMarshalServerWrapped(java.net.DatagramSocket socketIn, IPacketFactory factory, PacketLoader loader, FragmentationOptions fragmentationOptions, java.util.function.Function<java.io.InputStream,java.io.InputStream> inputStreamWrapper, java.util.function.Function<java.io.OutputStream,java.io.OutputStream> outputStreamWrapper)
DatagramSocket
, IPacketFactory
, PacketLoader
, FragmentationOptions
,
Function
for wrapping the input stream and the Function
for wrapping the output stream.socketIn
- The datagram socket to use.factory
- The packet factory to use.loader
- The packet loader to use.fragmentationOptions
- The fragmentation options, null to disable fragmentation.inputStreamWrapper
- The input stream wrapper to use (Can be null).outputStreamWrapper
- The output stream wrapper to use (Can be null).java.lang.NullPointerException
- socketIn, factory or loader is null.java.lang.IllegalArgumentException
- Fragmentation options failed validation.public java.util.function.Function<java.io.InputStream,java.io.InputStream> getWrapperInputStream()
Function
input stream wrapper function.public java.util.function.Function<java.io.OutputStream,java.io.OutputStream> getWrapperOutputStream()
Function
output stream wrapper function.