okhttp3.WebSocket.queueSize()方法的使用及代码示例

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

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

WebSocket.queueSize介绍

[英]Returns the size in bytes of all messages enqueued to be transmitted to the server. This doesn't include framing overhead. It also doesn't include any bytes buffered by the operating system or network intermediaries. This method returns 0 if no messages are waiting in the queue. If may return a nonzero value after the web socket has been canceled; this indicates that enqueued messages were not transmitted.
[中]返回排队要传输到服务器的所有消息的大小(字节)。这不包括框架开销。它也不包括操作系统或网络中介缓冲的任何字节。如果队列中没有消息等待,则此方法返回0。如果在取消web套接字后可能返回非零值;这表明排队的消息未被传输。

代码示例

代码示例来源:origin: watson-developer-cloud/java-sdk

while (socket.queueSize() > QUEUE_SIZE_LIMIT) {
 Thread.sleep(QUEUE_WAIT_MILLIS);

代码示例来源:origin: com.ibm.watson.developer_cloud/speech-to-text

while (socket.queueSize() > QUEUE_SIZE_LIMIT) {
 Thread.sleep(QUEUE_WAIT_MILLIS);

相关文章

微信公众号

最新文章

更多