Class RemoteServer
- java.lang.Object
-
- com.google.android.filament.utils.RemoteServer
-
public class RemoteServer extends java.lang.ObjectManages a tiny WebSocket server that can receive model data and viewer settings. Client apps can call acquireReceivedMessage to check for new data and pop it off the small internal queue.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemoteServer.ReceivedMessageEncapsulates a message sent from the web client.
-
Constructor Summary
Constructors Constructor Description RemoteServer(int port)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RemoteServer.ReceivedMessageacquireReceivedMessage()Pops a message off the incoming queue or returns null if there are no unread messages.voidclose()protected voidfinalize()static booleanisBinary(java.lang.String label)Checks if a peeked message has binary content.static booleanisJson(java.lang.String label)Checks if a peeked message has JSON content.java.lang.StringpeekIncomingLabel()Checks if a download is currently in progress and returns its label.
-
-
-
Method Detail
-
peekIncomingLabel
@Nullable public java.lang.String peekIncomingLabel()
Checks if a download is currently in progress and returns its label. Returns null if nothing is being downloaded.
-
isJson
public static boolean isJson(@Nullable java.lang.String label)Checks if a peeked message has JSON content.
-
isBinary
public static boolean isBinary(@Nullable java.lang.String label)Checks if a peeked message has binary content.
-
acquireReceivedMessage
@Nullable public RemoteServer.ReceivedMessage acquireReceivedMessage()
Pops a message off the incoming queue or returns null if there are no unread messages.
-
close
public void close()
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-