Description
Is your feature request related to a problem? Please describe.
I would like to implement socket activation for an application using Java WebSocket, specifically Robocode Tank Royale. Socket activation lets systemd start an application on demand when others try to connect to it.
Describe the solution you'd like
Using System.inheritedChannel
you can get access to a socket that was passed to the application as file descriptor 1. I'd like for there to be a constructor for WebSocketServer
that, instead of taking a port and listen address, accepts a pre-existing Channel
.
Describe alternatives you've considered
My specific use-case would also be solved by a constructor that calls System.inheritedChannel
itself, though I believe the other one I proposed is more flexible. Socket
Socket activation is not easily replaced and there is no clean strategy to emulate it without support from the application.
Thank you for consideration!