R - 请求信息public class UdpBootstrap<R> extends Object
| Constructor and Description |
|---|
UdpBootstrap(Protocol<R> protocol,
MessageProcessor<R> messageProcessor) |
| Modifier and Type | Method and Description |
|---|---|
UdpChannel<R> |
open()
开启一个UDP通道,端口号随机
|
UdpChannel<R> |
open(int port)
开启一个UDP通道
|
UdpChannel<R> |
open(String host,
int port)
开启一个UDP通道
|
UdpBootstrap<R> |
setReadBufferSize(int size)
设置读缓存区大小
|
UdpBootstrap<R> |
setThreadNum(int num)
设置线程大小
|
void |
shutdown() |
public UdpBootstrap(Protocol<R> protocol, MessageProcessor<R> messageProcessor)
public UdpChannel<R> open() throws IOException
IOException - 异常public UdpChannel<R> open(int port) throws IOException
port - 指定绑定端口号,为0则随机指定IOException - 异常public UdpChannel<R> open(String host, int port) throws IOException
host - 绑定本机地址port - 指定绑定端口号,为0则随机指定IOException - 异常public void shutdown()
public final UdpBootstrap<R> setReadBufferSize(int size)
size - 单位:bytepublic final UdpBootstrap<R> setThreadNum(int num)
num - 大小Copyright © 2021. All rights reserved.