Module technology.sola.engine
Class SocketMessageDecoder
java.lang.Object
technology.sola.engine.networking.socket.SocketMessageDecoder
SocketMessageDecoder is responsible for decoding
SocketMessage
s from payloads received over sockets.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable SocketMessage
decodeForRaw
(BufferedInputStream bufferedInputStream) Decodes a raw socket encoded message from the client.@Nullable SocketMessage
decodeForWeb
(BufferedInputStream bufferedInputStream) Decodes a web socket encoded message from the client.
-
Constructor Details
-
SocketMessageDecoder
public SocketMessageDecoder()
-
-
Method Details
-
decodeForRaw
public @Nullable SocketMessage decodeForRaw(BufferedInputStream bufferedInputStream) throws IOException Decodes a raw socket encoded message from the client. Note, this is a blocking operation.- Parameters:
bufferedInputStream
- theBufferedInputStream
to read the input from- Returns:
- the decoded message or null if disconnected
- Throws:
IOException
- if an I/O error occurs
-
decodeForWeb
public @Nullable SocketMessage decodeForWeb(BufferedInputStream bufferedInputStream) throws IOException Decodes a web socket encoded message from the client. Note, this is a blocking operation.- Parameters:
bufferedInputStream
- theBufferedInputStream
to read the input from- Returns:
- the decoded message or null if disconnected
- Throws:
IOException
- if an I/O error occurs
-