本文整理了Java中org.springframework.web.socket.sockjs.client.WebSocketTransport
类的一些代码示例,展示了WebSocketTransport
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebSocketTransport
类的具体详情如下:
包路径:org.springframework.web.socket.sockjs.client.WebSocketTransport
类名称:WebSocketTransport
[英]A SockJS Transport that uses a org.springframework.web.socket.client.WebSocketClient.
[中]使用组织的SockJS传输。springframework。网状物插座客户WebSocketClient。
代码示例来源:origin: spring-projects/spring-framework
@Override
protected Transport createWebSocketTransport() {
return new WebSocketTransport(new JettyWebSocketClient());
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public void start() {
if (!isRunning()) {
if (this.webSocketClient instanceof Lifecycle) {
((Lifecycle) this.webSocketClient).start();
}
else {
this.running = true;
}
}
}
代码示例来源:origin: spring-projects/spring-framework
@Override
protected Transport createWebSocketTransport() {
return new WebSocketTransport(new StandardWebSocketClient());
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public void stop() {
if (isRunning()) {
if (this.webSocketClient instanceof Lifecycle) {
((Lifecycle) this.webSocketClient).stop();
}
else {
this.running = false;
}
}
}
代码示例来源:origin: spring-projects/spring-integration
@Bean
public WebSocketClient webSocketClient() {
StandardWebSocketClient webSocketClient = new StandardWebSocketClient();
Map<String, Object> userProperties = new HashMap<>();
userProperties.put(Constants.IO_TIMEOUT_MS_PROPERTY, "" + (Constants.IO_TIMEOUT_MS_DEFAULT * 6));
webSocketClient.setUserProperties(userProperties);
return new SockJsClient(Collections.singletonList(new WebSocketTransport(webSocketClient)));
}
代码示例来源:origin: org.springframework/spring-websocket
@Override
public void start() {
if (!isRunning()) {
if (this.webSocketClient instanceof Lifecycle) {
((Lifecycle) this.webSocketClient).start();
}
else {
this.running = true;
}
}
}
代码示例来源:origin: spring-projects/spring-integration
@Bean
public WebSocketClient webSocketClient() {
return new SockJsClient(Collections.<Transport>singletonList(new WebSocketTransport(new StandardWebSocketClient())));
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public void stop() {
if (isRunning()) {
if (this.webSocketClient instanceof Lifecycle) {
((Lifecycle) this.webSocketClient).stop();
}
else {
this.running = false;
}
}
}
代码示例来源:origin: spring-projects/spring-integration
@Bean
public WebSocketClient webSocketClient() {
return new SockJsClient(Collections.<Transport>singletonList(new WebSocketTransport(new StandardWebSocketClient())));
}
代码示例来源:origin: org.springframework/spring-websocket
@Override
public void stop() {
if (isRunning()) {
if (this.webSocketClient instanceof Lifecycle) {
((Lifecycle) this.webSocketClient).stop();
}
else {
this.running = false;
}
}
}
代码示例来源:origin: spring-projects/spring-integration
@Bean
public WebSocketClient webSocketClient() {
return new SockJsClient(Collections.singletonList(new WebSocketTransport(new StandardWebSocketClient())));
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public void start() {
if (!isRunning()) {
if (this.webSocketClient instanceof Lifecycle) {
((Lifecycle) this.webSocketClient).start();
}
else {
this.running = true;
}
}
}
代码示例来源:origin: spring-projects/spring-integration
@Bean
public WebSocketClient webSocketClient() {
return new SockJsClient(Collections.<Transport>singletonList(new WebSocketTransport(new StandardWebSocketClient())));
}
代码示例来源:origin: spring-projects/spring-integration
@Bean
public WebSocketClient webSocketClient() {
return new SockJsClient(Collections.<Transport>singletonList(new WebSocketTransport(new StandardWebSocketClient())));
}
代码示例来源:origin: spring-projects/spring-integration
@Bean
public WebSocketClient webSocketClient() {
return new SockJsClient(Collections.<Transport>singletonList(new WebSocketTransport(new StandardWebSocketClient())));
}
代码示例来源:origin: mthizo247/spring-cloud-netflix-zuul-websocket
@Bean
@ConditionalOnMissingBean(WebSocketClient.class)
public WebSocketClient webSocketClient() {
StandardWebSocketClient webSocketClient = new StandardWebSocketClient();
List<Transport> transports = new ArrayList<>();
transports.add(new WebSocketTransport(webSocketClient));
return new SockJsClient(transports);
}
代码示例来源:origin: com.haulmont.addon.globalevents/cubaglevt-global
private WebSocketSession tryConnect(String serverUrl) throws ExecutionException, InterruptedException {
log.debug("Connecting to " + serverUrl);
StandardWebSocketClient standardWebSocketClient = new StandardWebSocketClient();
List<Transport> transports = new ArrayList<>(1);
transports.add(new WebSocketTransport(standardWebSocketClient));
SockJsClient sockJsClient = new SockJsClient(transports);
return sockJsClient
.doHandshake(new ClientWebSocketHandler(), serverUrl + "cubaglevt-ws/handler")
.get();
}
内容来源于网络,如有侵权,请联系作者删除!