on-internet
← Community

Handling image data over WebSocket in Spring Boot

Stack Overflow ·

I am building a shooting game. The phone is connected to the server through WebSocket. On the client side, when the player hits "shoot", the phone will capture a picture and get the current orientation of the phone. public record PlayerShootTrigger( byte[] imageData, Orientation orientation, @DecimalMin("0.0") @DecimalMax("1.0") double radius ) { public record Orientation( double x, double y, double z ) {} } Since I see there is a mix of binary and text data, how should my WebSocket handler deal with this? I checked the AbstractWebSocketHandler, they provide the handleTextMessage and handleBin

Comments

Sign in or sign up to comment and upvote.

No comments yet.