Simple TCP Chat Room in Java

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ม.ค. 2025

ความคิดเห็น • 88

  • @dgh25
    @dgh25 2 ปีที่แล้ว +65

    To run multiple clients in the IDE:
    1. Run the client class
    2. Click the down-arrow in the top right corner of Intellij where is says "Client"
    3. Click "Edit configurations..."
    4. In the "Run/Debug Configurations" dialog, click the "Modify options" arrow and select "Allow multiple instances"

  • @icodigo1
    @icodigo1 ปีที่แล้ว +7

    Love it when errors come up!, this is the real life while programming. So, also we learned how to troubleshoot our own code.

  • @Revamped1953
    @Revamped1953 ปีที่แล้ว +6

    you should make more of these java videos! python is cool but java seems cool too!

  • @mumk
    @mumk 3 ปีที่แล้ว +6

    This is a lot of fun, thanks!

  • @shieth314
    @shieth314 2 ปีที่แล้ว +4

    Thank you very much for the video! It was greatly helpful!
    Below are IntelliJ macros that could expedite the process for writing the main method and the standard output println method:
    - For main method: type 'psvm' then press tab to have the main method written fully
    - For System.out.println: type 'sout' then press tab to have the System.out.println method written fully

  • @eepikki
    @eepikki 3 ปีที่แล้ว +10

    I think this is the key to starting to learn java for me

    • @kaneki_ken_07
      @kaneki_ken_07 3 ปีที่แล้ว +1

      It's an interesting language, you should learn it.

    • @aditya_asundi
      @aditya_asundi 3 ปีที่แล้ว

      @@kaneki_ken_07 yes. Ppl say java is too wordy and takes a year to print hello world, but that's what makes it better. More syntax means the code is actually readable and customisable.

    • @eepikki
      @eepikki 3 ปีที่แล้ว

      @@kaneki_ken_07 I have done some basics but I have always just came back to Python. I love that too and it will always be number 1, but Java I feel could be a good skill

    • @meru_lpz
      @meru_lpz 3 ปีที่แล้ว

      It's a good time to start learning java, the language has actually been getting some updates to become less wordy (var, records)

    • @kaneki_ken_07
      @kaneki_ken_07 3 ปีที่แล้ว

      @@eepikki I aslo learned Python as my first language, and I too consider it as the king, C is kinda hard language, but JAVA was made with the reference to C, to get the functionality of C in easier syntax, so, you should learn JAVA as well besides Python, because Python somewhere lacks these features. And C is the most powerful language I have ever seen

  • @RanchoX
    @RanchoX ปีที่แล้ว +1

    The client connection probably doesn't close, because you're using .equals("/quit"), maybe the string has white spaces or next line characters which aren't captured by .equals(), .contains() is more useful on that use case

  • @kingofcurses0275
    @kingofcurses0275 9 หลายเดือนก่อน

    Thank you so much! you made it really easy to understand and implement.

  • @alicoder8
    @alicoder8 ปีที่แล้ว

    Positive. Useful and helpful. Like every video!🤟

  • @hema_hb
    @hema_hb 4 หลายเดือนก่อน

    Great tutorial ❤️👍🏼

  • @Dean-zi5bj
    @Dean-zi5bj ปีที่แล้ว

    Thank you, I really appreciate the good material, blessings to you and your family of happiness, abundance and good health.

  • @DayshiaSweet-t7n
    @DayshiaSweet-t7n 6 หลายเดือนก่อน

    great tutorial. learned alot!

  • @ChristianErwin01
    @ChristianErwin01 ปีที่แล้ว +2

    I'm able to run the server and after connecting with a client and entering the nickname, nothing happens on either end. Any reason why this may be?

    • @Doggy_Styles_Coding
      @Doggy_Styles_Coding ปีที่แล้ว

      out = new PrintWriter(client.getOutputStream(), true); The true is important (autoflush). it needs to be set true in both classes. otherwise the server can't recieve the message. I had the same issue after i forgot the vriable in the PrintWriter (autoflush = true).
      Hope it will fix it.

    • @gauravshah7888
      @gauravshah7888 2 หลายเดือนก่อน

      @@Doggy_Styles_Coding this fixed it, thanks 🙏

  • @sbipoaspirant2024
    @sbipoaspirant2024 11 หลายเดือนก่อน

    Hi! I have done the coding, the connections are establishing fine but the output stream and input streams are not being sent or received from server to client, can someone please help?

  • @Man-Vs-Car
    @Man-Vs-Car 3 ปีที่แล้ว +5

    Hope we can get more java videos. Nice!!

  • @psharma2067
    @psharma2067 3 ปีที่แล้ว +2

    Looks like neuralnine is reading our mind
    He is delivering content at right time

  • @nguyen1604
    @nguyen1604 ปีที่แล้ว +1

    Cannot invoke "java.io.BufferedReader.close()" because "this.in" is null
    I had bug in class Client
    Can you help me fix it?

    • @emxoco
      @emxoco ปีที่แล้ว

      did u fix it?

    • @emxoco
      @emxoco ปีที่แล้ว

      if yes, how?

    • @hokwanhung
      @hokwanhung ปีที่แล้ว

      ​@@emxoco I have fixed the problem; there are two parts: First, the port for ServerSocket (i.e. 9999) is already used; use something for TCP like 15001. Second, in the method of shutdown, include something like "if (in != null && !in.isClosed())"/"if (client != null && !client.isClosed())" so it actually will detect whether there are any sockets first.

  • @simo5678
    @simo5678 2 หลายเดือนก่อน +1

    Why is this code not in your github? :/

  • @jesusdacoast872
    @jesusdacoast872 3 ปีที่แล้ว

    Good job dude 😎

  • @Pages_Perfected
    @Pages_Perfected ปีที่แล้ว

    That was amazing, ty

  • @garethharriott9582
    @garethharriott9582 2 ปีที่แล้ว +2

    Im getting a real annoying error
    Apparently this.client is null
    I don't know what that means and google is no help

    • @BensStuff
      @BensStuff ปีที่แล้ว

      change the port to 9999

  • @zakyvids6566
    @zakyvids6566 3 ปีที่แล้ว +1

    Consider making a short maybe 1 hour crash course on JavaScript

  • @artofgamingwarfare3658
    @artofgamingwarfare3658 2 ปีที่แล้ว +1

    It's weird, I can run the server once, run a client on it. once i shut down the client, i'm not able to hit run on the server again. I think I may be missing something

    • @artofgamingwarfare3658
      @artofgamingwarfare3658 2 ปีที่แล้ว

      I don't think the server is shutting down. Edit: I got it figured out.

    • @nishanttanksale8451
      @nishanttanksale8451 2 ปีที่แล้ว

      @@artofgamingwarfare3658 what did you do?

    • @emanuel1657
      @emanuel1657 ปีที่แล้ว

      he probably had a dynamic ip and then changed it to static

  • @someonesomewhere7057
    @someonesomewhere7057 3 ปีที่แล้ว +1

    Might actually try to learn Java someday

  • @szilaszilaful
    @szilaszilaful 2 ปีที่แล้ว

    can you help? when running on different devices, it wont connect to server

  • @amanraval7027
    @amanraval7027 ปีที่แล้ว

    I think that this @override, basically i feel about it that this keyword @override is useless at line 3 because we use override for method that is have some work or some funtion to perform already but in your case the method "run" of the class Runnable just declare it is not performing any function so it looks meaninglessto me, but let meIknow if i mwrong, it would be appreciated😊🥰.

    • @debdeepsanyal9030
      @debdeepsanyal9030 9 หลายเดือนก่อน

      nope. you have to override and implement the run method, thats how multithreading in Java works. to start a Thread you basically call t.start() and this start method is calling the run() method in turn, hence it's important to override and implement the run() method. if you don't, you'll be getting an error.

  • @cheeesecake6989
    @cheeesecake6989 ปีที่แล้ว

    Thank you !! 🙏

  • @AlmightyFork
    @AlmightyFork 2 ปีที่แล้ว +1

    does someone know a tutorial for making a gui around this code?

  • @alxbudn
    @alxbudn 8 หลายเดือนก่อน

    does it work from 2 defferent laptops??

  • @dangeonmaster6839
    @dangeonmaster6839 2 ปีที่แล้ว

    How to clean ArrayList after disconnect?

  • @alanrichter8594
    @alanrichter8594 3 ปีที่แล้ว

    How You Made that with the command pydir in console You go to your python directory or any other

    • @jlee3361
      @jlee3361 3 ปีที่แล้ว

      Google bash aliasing

  • @aaron-XBass
    @aaron-XBass 2 ปีที่แล้ว

    That's pretty cool

  • @salahdjouama1221
    @salahdjouama1221 2 ปีที่แล้ว

    amazing it worked on the localhost but when i try it in two deferent divices (i changed the ip addresses) it doesnt idk why

  • @Sunnythesage
    @Sunnythesage 2 ปีที่แล้ว

    Thank you!

  • @prakhyathshetty6509
    @prakhyathshetty6509 10 หลายเดือนก่อน

    does it implement SSL

  • @ohkkai
    @ohkkai ปีที่แล้ว

    How do I get to this lvl of understanding? Gosh, I feel like I m stuck

  • @maksimbondarchuk8953
    @maksimbondarchuk8953 ปีที่แล้ว

    I dont get more than half what are you saying, but thats pretty interesting

  • @Zandulu
    @Zandulu 2 ปีที่แล้ว

    Thank you

  • @easchinta184
    @easchinta184 2 ปีที่แล้ว

    Great video! Does anyone know if I could share this file to a friend of mine and then we could chat remotely through terminals? Or if anyone knows any tutorials on how to do that? Let's say my friend cannot program so it would be great if he only needs to get a file and make open and connect through the terminal or something.

    • @Moosh_fr
      @Moosh_fr 2 ปีที่แล้ว

      you need to open the file or datatype in base64 or encode it. and then share it and turn it back

    • @CarlosFernandez-js8yn
      @CarlosFernandez-js8yn ปีที่แล้ว

      @@Moosh_fr can you elaborate a little more on this. What do you mean by turning it in base64?

  • @pconairofficial4333
    @pconairofficial4333 2 ปีที่แล้ว +1

    I respect you a bang

  • @yh4438
    @yh4438 ปีที่แล้ว

    Yo this so cool where can i find tutorial like this

  • @slicer8112
    @slicer8112 5 หลายเดือนก่อน

    Anyone know what theme he is using?

    • @IosebiGames
      @IosebiGames 2 หลายเดือนก่อน

      Music: Book rental wit it

    • @Arador1112
      @Arador1112 7 วันที่ผ่านมา

      dracula

  • @egormolkov7590
    @egormolkov7590 2 ปีที่แล้ว

    thx man!

  • @canadianbeast8671
    @canadianbeast8671 3 ปีที่แล้ว

    THANKS

  • @jackzytt
    @jackzytt 6 หลายเดือนก่อน

    doesnt work, doesnt let me run.

  • @anthonygarcia2459
    @anthonygarcia2459 ปีที่แล้ว

    This doesn't work if a user is typing a message while a new one is received from a different client. Please elaborate on how to fix this issue

  • @rosamaltonimussolini9715
    @rosamaltonimussolini9715 3 ปีที่แล้ว

    What program is it?

    • @NeuralNine
      @NeuralNine  3 ปีที่แล้ว

      A TCP chat room

    • @rosamaltonimussolini9715
      @rosamaltonimussolini9715 3 ปีที่แล้ว +1

      @@NeuralNinelike the deplovementing program (not java the program you use to deplov the chat room)

    • @omerselimatila3530
      @omerselimatila3530 3 ปีที่แล้ว +1

      @@rosamaltonimussolini9715 I think it isn't compitable with you, so never mind.

    • @rosamaltonimussolini9715
      @rosamaltonimussolini9715 3 ปีที่แล้ว +3

      @@omerselimatila3530 But I I can play a windows 10 VM :)

  • @ProgrammerRajaa
    @ProgrammerRajaa 3 ปีที่แล้ว

    how can I get the code ?

    • @MananGandhi
      @MananGandhi 3 ปีที่แล้ว +6

      you dont. the whole purpose of his videos are that people code on their own and don't just copy code

    • @07GT783
      @07GT783 ปีที่แล้ว +1

      @@MananGandhi you are absolutely right this is a tutorial project , not just a copy paste code project.

    • @eeeeeeeeee-d7x
      @eeeeeeeeee-d7x 11 หลายเดือนก่อน

      @@07GT783 have you ever considered that I don't want to break my ass watching all 40 minutes of his goddamn video trying to find where I missed a line of code that was shown for all of 5 themtoseconds so I can get a sample application to run? What difference does it make if you key in the code yourself or if you copy it from Github?

  • @xayahlover6688
    @xayahlover6688 2 ปีที่แล้ว

    Can you share the source code?

    • @oumaymajellali110
      @oumaymajellali110 2 ปีที่แล้ว

      Yes plzz

    • @Etka06
      @Etka06 11 หลายเดือนก่อน

      He did you just need to watch the video.

  • @GermanTimecrafter
    @GermanTimecrafter 3 ปีที่แล้ว

    Weird to see you coding in Java 😂

  • @mayursai7220
    @mayursai7220 3 ปีที่แล้ว

    Say this in c++ also

    • @yoyopiyoyopi
      @yoyopiyoyopi 3 ปีที่แล้ว +3

      Say it in english first

  • @brooth2566
    @brooth2566 ปีที่แล้ว

    cool but who really uses java now man

    • @gintoki8503
      @gintoki8503 ปีที่แล้ว +1

      💀 , I hope you realize that JAVA is used for a lot of things for example in space, the transmission of data from a satellite...I hope you will earn a brain. even for a lot of jobs employers ask for the applicants to know java.

    • @debdeepsanyal9030
      @debdeepsanyal9030 9 หลายเดือนก่อน

      Java is thriving in the backend s of literally all the companies you know of?

  • @youruncle4
    @youruncle4 2 ปีที่แล้ว

    s code plz