本文整理了Java中com.neovisionaries.ws.client.WebSocket.recreate()
方法的一些代码示例,展示了WebSocket.recreate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebSocket.recreate()
方法的具体详情如下:
包路径:com.neovisionaries.ws.client.WebSocket
类名称: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() {
内容来源于网络,如有侵权,请联系作者删除!