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