com.neovisionaries.ws.client.WebSocket.recreate()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中com.neovisionaries.ws.client.WebSocket.recreate()方法的一些代码示例,展示了WebSocket.recreate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebSocket.recreate()方法的具体详情如下:
包路径:com.neovisionaries.ws.client.WebSocket
类名称:WebSocket
方法名:recreate

WebSocket.recreate介绍

[英]Create a new WebSocket instance that has the same settings as this instance. Note that, however, settings you made on the raw socket are not copied.

The WebSocketFactory instance that you used to create this WebSocket instance is used again.

This method calls #recreate(int) with the timeout value that was used when this instance was created. If you want to create a socket connection with a different timeout value, use #recreate(int) method instead.
[中]创建与此实例具有相同设置的新WebSocket实例。但是,请注意,您在原始套接字上所做的设置不会被复制。
用于创建此WebSocket实例的WebSocketFactory实例将再次使用。
此方法使用创建此实例时使用的超时值调用#recreate(int)。如果要创建具有不同超时值的套接字连接,请改用#recreate(int)方法。

代码示例

代码示例来源:origin: TakahikoKawasaki/nv-websocket-client

/**
 * Create a new {@code WebSocket} instance that has the same settings
 * as this instance. Note that, however, settings you made on the raw
 * socket are not copied.
 *
 * <p>
 * The {@link WebSocketFactory} instance that you used to create this
 * {@code WebSocket} instance is used again.
 * </p>
 *
 * <p>
 * This method calls {@link #recreate(int)} with the timeout value that
 * was used when this instance was created. If you want to create a
 * socket connection with a different timeout value, use {@link
 * #recreate(int)} method instead.
 * </p>
 *
 * @return
 *         A new {@code WebSocket} instance.
 *
 * @throws IOException
 *         {@link WebSocketFactory#createSocket(URI)} threw an exception.
 *
 * @since 1.6
 */
public WebSocket recreate() throws IOException
{
  return recreate(mSocketConnector.getConnectionTimeout());
}

代码示例来源:origin: com.neovisionaries/nv-websocket-client

/**
 * Create a new {@code WebSocket} instance that has the same settings
 * as this instance. Note that, however, settings you made on the raw
 * socket are not copied.
 *
 * <p>
 * The {@link WebSocketFactory} instance that you used to create this
 * {@code WebSocket} instance is used again.
 * </p>
 *
 * <p>
 * This method calls {@link #recreate(int)} with the timeout value that
 * was used when this instance was created. If you want to create a
 * socket connection with a different timeout value, use {@link
 * #recreate(int)} method instead.
 * </p>
 *
 * @return
 *         A new {@code WebSocket} instance.
 *
 * @throws IOException
 *         {@link WebSocketFactory#createSocket(URI)} threw an exception.
 *
 * @since 1.6
 */
public WebSocket recreate() throws IOException
{
  return recreate(mSocketConnector.getConnectionTimeout());
}

代码示例来源:origin: blockchain/Android-Merchant-App

.addHeader("Origin", "https://blockchain.info").recreate()
.addListener(new WebSocketAdapter() {

相关文章