public interface JConnection
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clearAttributes()
清空属性
|
void |
close() |
CompletableFuture<Boolean> |
closeAsync() |
void |
flush() |
<T> T |
getAttachment()
获取附件
|
Object |
getAttribute(String key)
获取属性
|
Set<String> |
getAttributeNames()
获取属性key集合
|
int |
getId() |
InetSocketAddress |
getLocalAddress()
获取连接本地地址
|
InetSocketAddress |
getRemoteAddress()
获取连接远程地址
|
boolean |
hasAttribute(String key)
是否有属性
|
boolean |
isActive()
是否活跃打开
|
boolean |
isWritable()
是否可写,如果不可写则底层可能出现消息堆积
|
Object |
removeAttribute(String key)
移除属性
|
<T> void |
setAttachment(T attachment)
设置附件
|
void |
setAttribute(String key,
Object value)
设置属性
|
void |
write(byte[] bytes) |
void |
write(Object obj) |
void |
writeAndFlush(byte[] bytes) |
void |
writeAndFlush(Object obj) |
CompletableFuture<JConnection> |
writeAndFlushFutureAble(byte[] bytes) |
CompletableFuture<JConnection> |
writeAndFlushFutureAble(Object bytes) |
int getId()
boolean isActive()
boolean isWritable()
void write(Object obj)
void write(byte[] bytes)
void writeAndFlush(Object obj)
void writeAndFlush(byte[] bytes)
CompletableFuture<JConnection> writeAndFlushFutureAble(byte[] bytes)
CompletableFuture<JConnection> writeAndFlushFutureAble(Object bytes)
void flush()
void close()
CompletableFuture<Boolean> closeAsync()
InetSocketAddress getRemoteAddress()
InetSocketAddress getLocalAddress()
boolean hasAttribute(String key)
key - void clearAttributes()
<T> T getAttachment()
<T> void setAttachment(T attachment)
attachment - Copyright © 2020. All rights reserved.