If it is not explicitly told in following recipe, setting up services are described for Ubuntu 20.04 server, but applications are described for Xubuntu 20.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

11. Networking

Main steps

  1. If necessary, change value of static final int port = 7700 variable in TttNet.java class and value of port key in src/resources/appplication.properties configuration file to different number e.g. 7701
  2. Investigate jtm.activity11 package
  3. Run TttCli class in terminal, to see, how it works in terminal using standard input and output:

    java -cp target/classes/ jtm.activity11.TttCli

    and enter numbers of the cells.

  4. Implement TttNet class to run it either as a server (if port is available), or client (if server is listening to the port)
  5. When running as server is implemented:
    1. Run TttNet in one terminal:

      java -cp target/classes/ jtm.activity11.TttNet
    2. Check if server is listening, by runinng command in other terminal:

      ss -ntlp|grep 7700
    3. Check, how server part works with nc program as a client in other terminal:

      nc 127.0.1.1 7700

      and it should run in the same way as TttCli, with only difference,
      that data are sent through the network socket.

  6. When client part is implemented for TttNet class, it in another terminal:

    java -cp target/classes/ jtm.activity11.TttNet

    it should work in the same way as TttCli, with only difference,
    that data are sent through the network socket.

  7. If necessary, check all Java processes runnig by command:

    ps -efaw|grep java
  8. If necessary, application can be killed with command:

    kill -9 pid
    wher pid is process id from the previous command

Extra exercises

Additional info (in Latvian)


  

Created by Valdis Vītoliņš on 2017-01-03 08:07
Last modified by Valdis Vītoliņš on 2024-08-27 17:26
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License