Reputation: 65
I am developing a simple Java video streaming application using JavaFX. I can't use other libraries (vlcj) because of licensing. Anyway, my player works pretty fine, but I need to know on which local port it establishes connection. Since it seems that JavaFX doesn't offer such possibility, I am wondering if there is a way to catch/list all the Java opened connections/sockets.
Code follows, thanks in advance.
String mediaURL = "somepath";
Group root = new Group();
Scene scene = new Scene(root, 640, 480);
Media media = new Media(mediaURL);
MediaPlayer mediaPlayer = new MediaPlayer(media);
mediaPlayer.setAutoPlay(true);
MediaView mediaView = new MediaView(mediaPlayer);
mediaView.setCache(false);
root.getChildren().add(mediaView);
Upvotes: 2
Views: 4113
Reputation: 1658
On linux/mac, open a terminal and:
jps
command to find the pid
of your java processlsof -p <pid> |grep ESTABLISHED
to list the established connections.For windows you can check this SO post.
Upvotes: 4