public class NetworkConnection extends Object implements IConnection
| 构造器和说明 |
|---|
NetworkConnection(NetworkOption networkOption,
ICodec codec,
MessageProcessor processor,
ILogger logger,
ClientEnv clientEnv) |
NetworkConnection(NetworkOption networkOption,
ISslOption sslOption,
ICodec codec,
MessageProcessor processor,
ILogger logger) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
checkAndSetStatus(ChannelStatus status)
only heartbeat thread use
|
void |
close() |
boolean |
connect(Long connectionEndTime)
channel connect
|
boolean |
connectWithBtn(Long connectionEndTime) |
boolean |
disConnect()
channel disconnect
|
void |
disConnectForce()
disconnect, MessageProcessor threadPool will invoke
|
BaseChannel |
getChannel() |
Long |
getLastActiveTime() |
ChannelStatus |
getStatus() |
Long |
getSystemTimestamp() |
String |
getToEndpoint() |
void |
notifyEvent() |
void |
notifyEventInNewThread() |
boolean |
registerEventHandler(IConnectionCallback callback)
register event handler
|
boolean |
sendRequest(Request request,
Long connectionEndTime) |
boolean |
sendRequest(Request request,
Long connectionEndTime,
String toEndpoint) |
void |
setConnectIndex(int connectIndex) |
void |
setStatus(ChannelStatus channelStatus) |
void |
setSystemTimestamp(Long ts) |
void |
setToEndpoint(String toEndpoint) |
void |
start() |
void |
startWithBtn() |
void |
stop() |
void |
stopWithBtn() |
void |
updateLastActiveTime()
update last active time
|
public NetworkConnection(NetworkOption networkOption, ISslOption sslOption, ICodec codec, MessageProcessor processor, ILogger logger)
public NetworkConnection(NetworkOption networkOption, ICodec codec, MessageProcessor processor, ILogger logger, ClientEnv clientEnv)
public void start()
public void startWithBtn()
public void stop()
public void stopWithBtn()
public boolean connect(Long connectionEndTime)
IConnectionconnect 在接口中 IConnectionpublic boolean connectWithBtn(Long connectionEndTime)
connectWithBtn 在接口中 IConnectionpublic boolean disConnect()
IConnectiondisConnect 在接口中 IConnectionpublic boolean registerEventHandler(IConnectionCallback callback)
IConnectionregisterEventHandler 在接口中 IConnectioncallback - cbpublic Long getLastActiveTime()
public void updateLastActiveTime()
IConnectionupdateLastActiveTime 在接口中 IConnectionpublic void checkAndSetStatus(ChannelStatus status)
status - statuspublic void disConnectForce()
disConnectForce 在接口中 IConnectionpublic Long getSystemTimestamp()
public void setSystemTimestamp(Long ts)
public void setConnectIndex(int connectIndex)
public void notifyEventInNewThread()
public void notifyEvent()
public void close()
close 在接口中 Closeableclose 在接口中 AutoCloseablepublic BaseChannel getChannel()
public ChannelStatus getStatus()
public void setStatus(ChannelStatus channelStatus)
public String getToEndpoint()
public void setToEndpoint(String toEndpoint)
Copyright © 2022. All rights reserved.