本文整理汇总了Java中org.springframework.web.socket.PongMessage类的典型用法代码示例。如果您正苦于以下问题:Java PongMessage类的具体用法?Java PongMessage怎么用?Java PongMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PongMessage类属于org.springframework.web.socket包,在下文中一共展示了PongMessage类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: sendMessage
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
@Override
public final void sendMessage(WebSocketMessage<?> message) throws IOException {
checkNativeSessionInitialized();
Assert.isTrue(isOpen(), "Cannot send message after connection closed.");
if (logger.isTraceEnabled()) {
logger.trace("Sending " + message + ", " + this);
}
if (message instanceof TextMessage) {
sendTextMessage((TextMessage) message);
}
else if (message instanceof BinaryMessage) {
sendBinaryMessage((BinaryMessage) message);
}
else if (message instanceof PingMessage) {
sendPingMessage((PingMessage) message);
}
else if (message instanceof PongMessage) {
sendPongMessage((PongMessage) message);
}
else {
throw new IllegalStateException("Unexpected WebSocketMessage type: " + message);
}
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:27,代码来源:AbstractWebSocketSession.java
示例2: handleMessage
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
@Override
public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
if (message instanceof TextMessage) {
handleTextMessage(session, (TextMessage) message);
} else if (message instanceof PongMessage) {
handlePongMessage(session);
} else if (message instanceof BinaryMessage) {
session.close(CloseStatus.NOT_ACCEPTABLE.withReason("Binary messages not supported"));
} else {
throw new IllegalStateException("Unexpected WebSocket message type: " + message);
}
}
开发者ID:RWTH-i5-IDSG,项目名称:steve-plugsurfing,代码行数:16,代码来源:AbstractWebSocketEndpoint.java
示例3: handleMessage
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
@Override
public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
if (message instanceof TextMessage) {
handleTextMessage(session, (TextMessage) message);
}
else if (message instanceof BinaryMessage) {
handleBinaryMessage(session, (BinaryMessage) message);
}
else if (message instanceof PongMessage) {
handlePongMessage(session, (PongMessage) message);
}
else {
throw new IllegalStateException("Unexpected WebSocket message type: " + message);
}
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:16,代码来源:AbstractWebSocketHandler.java
示例4: handlePongMessage
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
private void handlePongMessage(javax.websocket.Session session, ByteBuffer payload) {
PongMessage pongMessage = new PongMessage(payload);
try {
this.handler.handleMessage(this.wsSession, pongMessage);
}
catch (Throwable ex) {
ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger);
}
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:StandardWebSocketHandlerAdapter.java
示例5: onWebSocketFrame
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
@OnWebSocketFrame
public void onWebSocketFrame(Frame frame) {
if (OpCode.PONG == frame.getOpCode()) {
ByteBuffer payload = frame.getPayload() != null ? frame.getPayload() : EMPTY_PAYLOAD;
PongMessage message = new PongMessage(payload);
try {
this.webSocketHandler.handleMessage(this.wsSession, message);
}
catch (Throwable ex) {
ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger);
}
}
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:14,代码来源:JettyWebSocketHandlerAdapter.java
示例6: handlePongMessage
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
protected void handlePongMessage(WebSocketSession session, PongMessage message) throws Exception {
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:3,代码来源:AbstractWebSocketHandler.java
示例7: sendPongMessage
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
@Override
protected void sendPongMessage(PongMessage message) throws IOException {
getNativeSession().getBasicRemote().sendPong(message.getPayload());
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:StandardWebSocketSession.java
示例8: sendPongMessage
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
@Override
protected void sendPongMessage(PongMessage message) throws IOException {
getNativeSession().getRemote().sendPong(message.getPayload());
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:JettyWebSocketSession.java
示例9: handleWebSocketMessagePong
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
@Test
public void handleWebSocketMessagePong() throws Exception {
connect().handleMessage(this.webSocketSession, new PongMessage());
verifyNoMoreInteractions(this.stompSession);
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:6,代码来源:WebSocketStompClientTests.java
示例10: handlePongMessage
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
@Override
protected void handlePongMessage(WebSocketSession session, PongMessage message) throws Exception {
// TODO Auto-generated method stub
super.handlePongMessage(session, message);
}
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:6,代码来源:TestRunHandler.java
示例11: handlePongMessage
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
@Override
protected void handlePongMessage(WebSocketSession session, PongMessage message) throws Exception {
logger.debug("Pong received for session {}", session.getId());
}
开发者ID:devicehive,项目名称:devicehive-java-server,代码行数:5,代码来源:DeviceHiveWebSocketHandler.java
示例12: handlePongMessage
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
/**
* ping-pong
*
* @param session
* @param message
* @throws Exception
*/
@Override
protected void handlePongMessage(WebSocketSession session, PongMessage message) throws Exception {
}
开发者ID:zhaoshuxue,项目名称:springBoot,代码行数:12,代码来源:GameHandler.java
示例13: sendPongMessage
import org.springframework.web.socket.PongMessage; //导入依赖的package包/类
protected abstract void sendPongMessage(PongMessage message) throws IOException;
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:2,代码来源:AbstractWebSocketSession.java
注:本文中的org.springframework.web.socket.PongMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论