public class JetlangNioSession extends JetlangBaseSession implements JetlangMessageHandler
Modifier and Type | Class and Description |
---|---|
static interface |
JetlangNioSession.ErrorHandler |
Heartbeat, id, Logout, Messages, ReadTimeout, SessionClose, SessionRequest, SubscriptionRequest, UnsubscribeRequest
Constructor and Description |
---|
JetlangNioSession(org.jetlang.fibers.NioFiber fiber,
SocketChannel channel,
NioJetlangSendFiber sendFiber,
NioJetlangRemotingClientFactory.Id id,
JetlangNioSession.ErrorHandler errorHandler) |
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Attempts to disconnect the client.
|
void |
onClose(SessionCloseEvent sessionCloseEvent) |
void |
onLogout() |
void |
onRequestReply(int reqId,
String dataTopicVal,
Object readObject) |
void |
onSubscriptionRequest(String topic) |
void |
onUnknownMessage(int read) |
void |
onUnsubscribeRequest(String topic) |
void |
publish(byte[] data)
publish raw bytes.
|
<T> void |
publish(String topic,
T msg) |
void |
publishIfSubscribed(String topic,
byte[] data) |
void |
reply(int reqId,
String replyTopic,
Object replyMsg) |
void |
sendHb() |
getHeartbeatChannel, getLogoutChannel, getReadTimeoutChannel, getSessionCloseChannel, getSessionId, getSessionMessageChannel, getSessionRequestChannel, getSubscriptionRequestChannel, getUnsubscribeChannel, newChannel, onHb, onMessage, onReadTimeout, onRequest
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSessionId, onReadTimeout
onHb, onMessage, onRequest
public JetlangNioSession(org.jetlang.fibers.NioFiber fiber, SocketChannel channel, NioJetlangSendFiber sendFiber, NioJetlangRemotingClientFactory.Id id, JetlangNioSession.ErrorHandler errorHandler)
public void sendHb()
public void onLogout()
onLogout
in interface JetlangRemotingProtocol.Handler
onLogout
in class JetlangBaseSession
public void onSubscriptionRequest(String topic)
onSubscriptionRequest
in interface JetlangRemotingProtocol.Handler
onSubscriptionRequest
in class JetlangBaseSession
public void onUnsubscribeRequest(String topic)
onUnsubscribeRequest
in interface JetlangRemotingProtocol.Handler
onUnsubscribeRequest
in class JetlangBaseSession
public <T> void publish(String topic, T msg)
publish
in interface JetlangMessagePublisher
publish
in interface JetlangSession
public void disconnect()
JetlangSession
disconnect
in interface JetlangSession
public void publish(byte[] data)
JetlangSession
publish
in interface JetlangSession
publish
in class JetlangBaseSession
public void reply(int reqId, String replyTopic, Object replyMsg)
reply
in interface JetlangMessagePublisher
reply
in class JetlangBaseSession
public void onRequestReply(int reqId, String dataTopicVal, Object readObject)
onRequestReply
in interface JetlangRemotingProtocol.Handler
public void publishIfSubscribed(String topic, byte[] data)
publishIfSubscribed
in class JetlangBaseSession
public void onClose(SessionCloseEvent sessionCloseEvent)
onClose
in class JetlangBaseSession
public void onUnknownMessage(int read)
onUnknownMessage
in interface JetlangRemotingProtocol.Handler
Copyright © 2016. All Rights Reserved.