/** 发送注销消息 */ public boolean sendLogoutMessage() { STEPParser app = ParserConfig.getInstance().getStep(); Message message = StepMessage.getLogoutMessage(app); session.write(message); try { doLock(); } catch (InterruptedException e) { log.error("Send Logout Message InterruptedException: ", e); } return false; }
/** * 发送登录消息 * * @param userName 用户名 * @param password 密码 */ public boolean sendLoginMessage(String userName, String password) { STEPParser app = ParserConfig.getInstance().getStep(); Message message = StepMessage.getLoginMessage(app, ExpressConstant.HEARTBEATRATE, userName, password); session.write(message); try { doLock(); } catch (InterruptedException e) { log.error("Send Login Message InterruptedException: ", e); } if (isLockOk()) { // 登录成功开启定时心跳发送 healthDaemon = new HealthDaemon(session); } return isLockOk(); }
/** send发送订阅消息 */ public void sendMarketMessage(MarketType mrkType) { // 发送订阅消息 STEPParser app = ParserConfig.getInstance().getStep(); Message marketMessage = StepMessage.getMarketSubscribeMessage(app, mrkType.getMkdRequest()); session.write(marketMessage); }