public class WebSocketStreamHandler extends java.lang.Object implements WebSockets.SocketListener, java.io.Closeable
| Constructor and Description |
|---|
WebSocketStreamHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
bytesMessage(java.io.InputStream in)
Called when a binary media type message is received
|
void |
close()
Called when the stream is closed.
|
java.io.InputStream |
getInputStream(int stream)
Get a specific input stream using its identifier.
|
java.io.OutputStream |
getOutputStream(int stream)
Gets a specific output stream using it's identified
|
protected void |
handleMessage(int stream,
java.io.InputStream inStream) |
void |
open(java.lang.String protocol,
com.squareup.okhttp.ws.WebSocket socket)
Called when the socket is opened
|
void |
textMessage(java.io.Reader in)
Called when a text media type message is received
|
public void open(java.lang.String protocol,
com.squareup.okhttp.ws.WebSocket socket)
WebSockets.SocketListeneropen in interface WebSockets.SocketListenerpublic void bytesMessage(java.io.InputStream in)
WebSockets.SocketListenerbytesMessage in interface WebSockets.SocketListenerin - The input stream containing the binary datapublic void textMessage(java.io.Reader in)
WebSockets.SocketListenertextMessage in interface WebSockets.SocketListenerin - The character stream containing the messageprotected void handleMessage(int stream,
java.io.InputStream inStream)
throws java.io.IOException
java.io.IOExceptionpublic void close()
WebSockets.SocketListenerclose in interface WebSockets.SocketListenerclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic java.io.InputStream getInputStream(int stream)
stream - The stream to returnpublic java.io.OutputStream getOutputStream(int stream)
stream - The stream to returnCopyright © 2019. All rights reserved.