Means, that it will get connections from many users in local web. How can i get IP address each single connection? I use JSR356.
@ServerEndpoint(value = "/ws/example")
public class ExampleServlet {
private static final AtomicInteger connectionIds = new AtomicInteger(0);
private static final Set<ExampleServlet> connections = new CopyOnWriteArraySet<>();
private Session session;
@OnOpen
public void start(Session session) {
this.session = session;
connections.add(this);
}
@OnClose
public void end() {
}
@OnMessage
public void incoming(String message) {
}
@OnError
public void onError(Throwable t) throws Throwable {
}
}