My task is to implement an application that will accept all the information that comes to a certain port. It should work like Wireshark.
This code should listen to everything that comes to port 46122. In Wireshark, I see that some information comes to this port. But my program does not see anything.
ServerSocket serverSocket = new ServerSocket(46122);
Socket clientSocket = serverSocket.accept();
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
BufferedReader in = new BufferedReader(
new InputStreamReader(clientSocket.getInputStream()));