
public final class WaarpNettyUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MINIMAL_DELAY_MS
Minimal delay (OS sleep minimal time)
|
static int |
SIMPLE_DELAY_MS
Used in final operation to wait for extra works
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
availablePort(int port)
Checks to see if a specific port is available.
|
static boolean |
availablePort(int port,
InetAddress localAddress)
Checks to see if a specific port is available.
|
static boolean |
awaitIsSuccessOfInterrupted(io.netty.util.concurrent.Future<?> future) |
static boolean |
awaitOrInterrupted(io.netty.util.concurrent.Future<?> future) |
static boolean |
awaitOrInterrupted(io.netty.util.concurrent.Future<?> future,
long timeMilliseconds) |
static boolean |
release(io.netty.buffer.ByteBuf byteBuf)
Shortcut to release a ByteByf
|
static void |
releaseCompletely(io.netty.buffer.ByteBuf byteBuf)
Shortcut to release completely a ByteByf
|
static void |
retain(io.netty.buffer.ByteBuf byteBuf)
Retain this ByteBuf
|
static void |
setBootstrap(io.netty.bootstrap.Bootstrap bootstrap,
io.netty.channel.EventLoopGroup group,
int timeout)
Add default configuration for client bootstrap
|
static void |
setBootstrap(io.netty.bootstrap.Bootstrap bootstrap,
io.netty.channel.EventLoopGroup group,
int timeout,
int maxBufSize,
boolean autoRead)
Add default configuration for client bootstrap
|
static void |
setServerBootstrap(io.netty.bootstrap.ServerBootstrap bootstrap,
io.netty.channel.EventLoopGroup parentGroup,
io.netty.channel.EventLoopGroup childGroup,
int timeout)
Add default configuration for server bootstrap
|
static void |
setServerBootstrap(io.netty.bootstrap.ServerBootstrap bootstrap,
io.netty.channel.EventLoopGroup parentGroup,
io.netty.channel.EventLoopGroup childGroup,
int timeout,
int maxBufSize,
boolean autoRead)
Add default configuration for server bootstrap
|
static io.netty.buffer.ByteBuf |
slice(io.netty.buffer.ByteBuf byteBuf,
int start,
int size)
Utility method to return a ByteBuf slice with Write ready.
|
static io.netty.buffer.ByteBuf |
wrappedBuffer(byte[]... arrays)
Use the best approach
|
public static final int SIMPLE_DELAY_MS
public static final int MINIMAL_DELAY_MS
public static void setBootstrap(io.netty.bootstrap.Bootstrap bootstrap,
io.netty.channel.EventLoopGroup group,
int timeout)
bootstrap - group - timeout - public static void setBootstrap(io.netty.bootstrap.Bootstrap bootstrap,
io.netty.channel.EventLoopGroup group,
int timeout,
int maxBufSize,
boolean autoRead)
bootstrap - group - timeout - maxBufSize - autoRead - public static void setServerBootstrap(io.netty.bootstrap.ServerBootstrap bootstrap,
io.netty.channel.EventLoopGroup parentGroup,
io.netty.channel.EventLoopGroup childGroup,
int timeout)
bootstrap - parentGroup - childGroup - timeout - public static void setServerBootstrap(io.netty.bootstrap.ServerBootstrap bootstrap,
io.netty.channel.EventLoopGroup parentGroup,
io.netty.channel.EventLoopGroup childGroup,
int timeout,
int maxBufSize,
boolean autoRead)
bootstrap - parentGroup - childGroup - timeout - maxBufSize - autoRead - public static boolean availablePort(int port)
port - the port to check for availabilitypublic static boolean availablePort(int port,
InetAddress localAddress)
port - the port to check for availabilitylocalAddress - the associated localAddress to usepublic static boolean awaitOrInterrupted(io.netty.util.concurrent.Future<?> future)
future - public static boolean awaitOrInterrupted(io.netty.util.concurrent.Future<?> future,
long timeMilliseconds)
future - timeMilliseconds - public static boolean awaitIsSuccessOfInterrupted(io.netty.util.concurrent.Future<?> future)
future - public static boolean release(io.netty.buffer.ByteBuf byteBuf)
byteBuf - public static void releaseCompletely(io.netty.buffer.ByteBuf byteBuf)
byteBuf - public static void retain(io.netty.buffer.ByteBuf byteBuf)
byteBuf - public static io.netty.buffer.ByteBuf slice(io.netty.buffer.ByteBuf byteBuf,
int start,
int size)
byteBuf - start - size - public static io.netty.buffer.ByteBuf wrappedBuffer(byte[]... arrays)
arrays - Copyright © 2009–2022 Waarp. All rights reserved.