public class JetlangStreamSession extends JetlangBaseSession implements JetlangRemotingProtocol.Handler
Heartbeat, id, Logout, Messages, ReadTimeout, SessionClose, SessionRequest, SubscriptionRequest, UnsubscribeRequest
Constructor and Description |
---|
JetlangStreamSession(Object id,
MessageStreamWriter socket,
org.jetlang.fibers.Fiber sendFiber,
ErrorHandler errorHandler) |
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Attempts to disconnect the client.
|
void |
onLogout() |
void |
onRequestReply(int reqId,
String dataTopicVal,
Object readObject) |
void |
onSubscriptionRequest(String topic) |
void |
onUnknownMessage(int read) |
void |
onUnsubscribeRequest(String top) |
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 |
startHeartbeat(int interval,
TimeUnit unit) |
getHeartbeatChannel, getLogoutChannel, getReadTimeoutChannel, getSessionCloseChannel, getSessionId, getSessionMessageChannel, getSessionRequestChannel, getSubscriptionRequestChannel, getUnsubscribeChannel, newChannel, onClose, onHb, onMessage, onReadTimeout, onRequest
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onHb, onMessage, onRequest
public JetlangStreamSession(Object id, MessageStreamWriter socket, org.jetlang.fibers.Fiber sendFiber, ErrorHandler errorHandler)
public void startHeartbeat(int interval, TimeUnit unit)
public void onSubscriptionRequest(String topic)
onSubscriptionRequest
in interface JetlangRemotingProtocol.Handler
onSubscriptionRequest
in class JetlangBaseSession
public void onUnsubscribeRequest(String top)
onUnsubscribeRequest
in interface JetlangRemotingProtocol.Handler
onUnsubscribeRequest
in class JetlangBaseSession
public void disconnect()
JetlangSession
disconnect
in interface JetlangSession
public void onLogout()
onLogout
in interface JetlangRemotingProtocol.Handler
onLogout
in class JetlangBaseSession
public void onUnknownMessage(int read)
onUnknownMessage
in interface JetlangRemotingProtocol.Handler
public <T> void publish(String topic, T msg)
publish
in interface JetlangMessagePublisher
publish
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
Copyright © 2016. All Rights Reserved.