Java Swing Threading Basics

Поділитися
Вставка
  • Опубліковано 18 жов 2024
  • Introduction to why you might want to make your graphical user interface multi-threaded, and related issues.

КОМЕНТАРІ • 7

  • @Mindinmatrix
    @Mindinmatrix 2 роки тому +1

    I have a ridiculous assignment coming up at school. This is helping me considerably! Thank you so much Geoff!

  • @eneskosar4649
    @eneskosar4649 Рік тому

    Great video, thanks for everything

  • @MgsMen
    @MgsMen Рік тому

    Thanks a lot, your guide is very useful !

  • @alexandrutudoran3941
    @alexandrutudoran3941 2 роки тому +2

    Hi. Thank you for your video!
    I have a question. I have a client sever application that is used for simulating a lot of security protocols and attacks. What I’m trying to do now is to create two GUIs, one for server and one for each client. I’m having a few issues on how to start the server (on which thread) and also how can I come back from the bottom to the GUI frame with notifications such as: client connected, client disconnected so I can actually show those kind of things.
    How would you approach this?
    Consider I have everything else written down. I just need to find out a clear way how to start the server and the client from top to bottom and how to come back again with these notifications.

    • @gea257
      @gea257  2 роки тому

      Thank you for your comment. Generally, when you're doing client/server, each client and each server is a separate process. They could all be written in Java, but each one is in its own JVM, so there's no contention around which thread or which frame, because they have their own threads and frames. By the way, it would be unusual for a server to have a Swing GUI, because servers are generally remote administered.
      Practical attacks rely on implementation flaws (buffer overruns, information leakage, etc.) When researching them, you'd want to install and run an existing program that implements the technology stack in question. Then you write client code to script the attack. (Java can be used for that, but Python is the more popular choice.) Theoretical attacks are about weaknesses in the algorithm being implemented, and are mostly math. Neither kind requires you to write your own server, which is what it sounds like you're doing.
      In most production code, notification messages along the lines of "client connected" are handled with a logging framework and routed to a log file or (on Windows) the Event Viewer. I think what you are looking for is a way to consolidate those messages into a single view so you can follow the sequence of events across programs. To that end, it is possible to install and run your own logging server. To answer your question, my approach would be to configure your clients and servers to send log messages to a logging server of your choice.

  • @chupapimunanyo2596
    @chupapimunanyo2596 2 роки тому +2

    Knock Knock
    _race condition_
    Who‘s there ?

    • @upliftingspirit6873
      @upliftingspirit6873 Рік тому +1

      How can one avoid race condition issues? I guess using just the Thread class is not a good practice. What would be a better solution?