Java Socket Programming Client Server Messenger

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ย. 2024

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

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

    i've been really sad last few days because my teacher expects so much from us, and he doesnt even try to explain and makes me want to quit programming so bad...he just doesnt care...this video helps a bit! greetings from croatia!

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

      Hey! It's awful having a teacher that doesn't put in the time to explain things! Hope it gets better and hello from the US 🤠

  • @user-uh4if7yp9v
    @user-uh4if7yp9v 4 ปีที่แล้ว +16

    I learn more from your videos than I ever did in school. I look forward to seeing your tiny head on my screen every day!

    • @WittCode
      @WittCode  4 ปีที่แล้ว

      Thanks for watching!

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

    This video is a great help, thanks a lot. I appreciate how you put work on this video, you gave lots of information, put extra info at the bottom, and gave a quick tour of what's happening at backstage of the program. Thanks a lot man.

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

      Thanks so much for all the positive feedback! It means more than you know! 😀

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

    Amazing video the little captions helped a lot and actually explaining each command line by line is so helpful or the fact that a byte has stream while others have reader. So much better than my prof and im paying 20k in tuition

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

    I wish I hadn't wasted time on other TH-cam videos, thanks alot... You hv simplified my work and understanding... Great job

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

    Shock to see how few videos he's got given how GOOD he is...

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

      Wow thanks Mark! That really means a lot! 🤠

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

    Great video, especially the way you explain the concepts and give definitions for important terms!

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

    Dude this is absolutely fantastic. You keep going like this and you’ll do amazing. Thank you

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

    Really great explanation. Those short infos you used are really helpful :)

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

      Thanks Fabio! Glad it was helpful! 😀

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

    learned alot from the video! but can i make a suggestion to zoom in a little when you are typing in the code to make viewing a little easier on the eye. As someone who was trying to follow along with my own IDE, it was hard to have both screens at the same time. thanks again! :)

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

    Very underrated thanks for the good explanation and explaining every part good luck with your channel!

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

    Thanks for explaining how the streams and readers actually work! Great Video!

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

    Thanks for the help.I was doing the same practice but had no idea what host ip address to put in.Here I see you just put localhost as the target host.Thanks

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

    Thank you. This filled in some pretty sketchy holes in my knowledge before a term assignment.

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

    Thank for for the tutorial. You put so much effort into the vid to make it understandable thank you!

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

    Great tutorial, thank you for your time and effort. The short definitions/explanations helped tremendously. 🙏

  • @beterax
    @beterax 3 หลายเดือนก่อน +2

    Bombastic explanation!

    • @WittCode
      @WittCode  3 หลายเดือนก่อน

      💣

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

    This has been a great help to me I will definitely recommend you to my friends because they need help on this too

  • @MrUnknown-il4pm
    @MrUnknown-il4pm 2 ปีที่แล้ว

    Dude thank you so much. This helled me undestand a lot! Instantly subscribed! Keep it up man 👍👌

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

    The source code is not in the website

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

    I haven't seen this video yet! But awesome! I needed this for class 😬😬

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

      Always great to hear! Thanks! 😎

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

    Hello, can I put the server and client in different devices would they work then??

  • @ירדןשי-צ2ה
    @ירדןשי-צ2ה หลายเดือนก่อน

    I had issue with the server.
    Every time I typed "bye" it closed the program but kept the server on.
    The way to fix it was by deleting the second loop in the server's code.
    Now the only problem is:
    There are still "broken" ports that I can't use anymore, they throw the error: "Exception in thread "main" java.net.BindException: Address already in use: bind ...."
    I'm trying to find out how to fix that and I will update if I find an answer!

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

    Fantastic video just a little suggestion try to zoom in a bit

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

    Amazing! I am a programming beginner and could follow you very well, I will check out your other videos as well :) Good Job, thank you a lot!

  • @Animelover_4242
    @Animelover_4242 18 วันที่ผ่านมา

    this video is really help me to understand

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

    You're a great teacher!

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

    For the server, it gives me trouble for the while loop. and when I run either one of them it says connection refused.

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

    Thank you for this, I've successfully configured this but let's say I have multiple clients sending to the server. How would I keep the client data & send it to all clients on that server?

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

    dude, this helped me solve my homework AND it deepened my understanding, thank u so much

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

    Thank you soo much it helped a lot looking forward to learn from you

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

    When I send the Message "BYE" to end the connection the Client works as expected but my Server throws the following Exception:
    Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.lang.String.equalsIgnoreCase(java.lang.String)" because "msgFromClient" is null
    at com.view/com.model.Server.main(Server.java:53)
    Any suggestions what is going wrong? I copied the code 1:1 to be sure it works..
    Thanks so far for the video!!

  • @HarpreetSingh-cl1sp
    @HarpreetSingh-cl1sp 2 ปีที่แล้ว

    Thanks for video. But please tell if i build friends live location app. By using android studio . Can we send data i app to other throw sockets.... I means i can't use firebase for storing and sending LONGITUDE AND LATITUDE data to server to client app ?

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

    Very good keep going 👍💙

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

    Thank you so much for this tutorial!

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

      Thank you for watching! 😁

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

    thanks for the tutorial, but I can't send multiple messages to the server at the same time, every time I want that , I must reconnect the client to the server again , I just wrote the same code of the tutorial

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

    thanks for the tutorial, what about different device connecting to the same network?

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

    how to make other computer join the conversation or how to other computer connect to your pc which run java server code

  • @jhuluan-jyun2594
    @jhuluan-jyun2594 2 ปีที่แล้ว

    Really helpful sir! Appreciate it a lot

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

    i am trying the above code nut for a specific host address and port, iam getting connection refused or connection timeout, can someone tell me what iam doing wrong?

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

    Can you please do GUI + DB reads/writes + Socket all in one? Love your work

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

    Is your source code available anywhere?
    I’m certain I’ve copied your tutorial step by step, but unfortunately I’m running into errors.
    I’m able to send one message from the client just fine. It shows up in the sever terminal perfectly!
    Whenever I try to send a second message, however, my client terminal says “Sever: null” instead of “Sever: MSG Received”
    and then any further attempts crashes the program.
    Edit: Scratch that. For some reason, closing out of my IDE and reopening it cleared that issue. Thanks a ton for the tutorial!

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

      Could u plz share that code with me.plzz🙏🙏

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

    is there anyway to make the server talk back other than message recieved

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

    Excellent tutorial.

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

    Can we do this setup for remote client

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

    For some reason it doesn't work for me and i copied it word for word
    And this project doesn't exist at the download link to download it

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

    What code do I use to be able to block a client in my application

  • @RonyTheRhombus.
    @RonyTheRhombus. 2 ปีที่แล้ว

    Really great video thank you!

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

    @WittCode thanks! Can you make a video like this with multiple clients/threads?

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

      Hey! Thanks for watching! I'm working on that and a couple other videos at the moment!

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

    Thanks for that video !

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

    good video...very informative!

    • @WittCode
      @WittCode  4 ปีที่แล้ว

      Thanks for watching Michael!

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

    Great video, thanks a lot man!

  • @alireza.m
    @alireza.m ปีที่แล้ว

    Very helpful video!

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

    where can i find the code for this it is not on the blog :(((

  • @LE.LL0
    @LE.LL0 3 ปีที่แล้ว

    how can you make the server in a way that you can close and start the connection while running the program? and thank you for this amazing content.

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

    can you help me? I can not find the file to download the code

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

    how to send the message in following
    form → {message, SHA_256_hash_value}. Once the server receives the message it will parse it, calculate
    the SHA_256 hash value of the message part and compare it with the received hash. If values are
    matching it will send 'OK' back to Client, else 'Message was compromised'.

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

      Hey there! That sounds to me like you are trying to implement something similar to a json web token. Id look up online about that and some library in java for encrypting and decrypting?

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

      @@WittCode yes

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

    Great tutorial!

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

    Thanks! Helped me alot :D

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

    Very good, thank you!

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

    dude this is amazing
    thank you

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

      Great to hear man! Thanks for the support! 😁

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

    Did I stuff up, because for me the Client and Server must be on the same computer. If this is a general thing, how can I fix this.

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

      Hey there! If you are wanting to connect to a different computer you have to specify the IP address in the socket constructor. So instead of new Socket("localhost", 1234) you will need the connection information of your server. This can get a little messy due to network address translation (going from a public to private network essentially). I am hoping to make a video on this soon when I get a second computer haha

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

      @@WittCode Also what type of IP? e.g. IPv4 IPv6 etc

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

      @@montescottbarber9813 Great question! The socket constructor can accept either so it just depends on if the server you are connecting to is using ipv6 or ipv4. For example, localhost on ipv6 would be the following: Socket socket = new Socket("::1", 5000);

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

      @@WittCode Thanks for responding. Ur the best.👌👍

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

      @@WittCode Hi there, I have the same code as you but i get lots of these errors 'Server.java:56: error: cannot find symbol
      bufferedReader.close();'

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

    This is a fantastic video. Intelliji is in light mode tho. And for that reason I'm out.

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

      Thanks so much Bezalel! I have gotten a few comments about the light mode 😂😂

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

    Nice job. Keep it up. Can I know how to send msg sever to client what are the changes should I do for it

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

      Hey Kalana! The code would basically be the same but have it so the client is waiting for messages as opposed to the server! I'll probably make a video on this at some point 🤠

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

    I don't really can see this video, it's too small for me :/

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

    This is TCP or UDP?

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

    This video is so awesome.Thank you for sharing.I am cant seem to enter more than one input from the clients side.After saying hi,the server replies message received.Then I cannot enter any other entries from the client.Is any one else having this issue?

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

      Hey there! Thanks so much for watching! To me it sounds like your client is waiting for more data from the server! Did you forget to flush the buffer from the server along with a new line?

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

      @@WittCode Thank you for the feedback,Yes I did flush the buffer from the server along with the new line.
      github.com/Hloni-Malebana/Client-Server-Algorithm.git

  • @Sauce-ke
    @Sauce-ke 4 หลายเดือนก่อน

    I cant find the code for this

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

    Please where can I get the code? Is it for free?

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

    Thank you!

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

      Anytime Christopher thanks for watching!

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

    This saved me 🙏

  • @Tech_Inside.
    @Tech_Inside. ปีที่แล้ว

    Not getting code ? Plz put jt

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

    thank you

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

    Awesome...

  • @VinayKumar-tv5bc
    @VinayKumar-tv5bc 3 ปีที่แล้ว

    pls share code also

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

    i just get a bunch (18) of these errors!!!!!
    'symbol: variable bufferedReader
    location: class Server
    Server.java:57: error: cannot find symbol
    bufferedWriter.close();'

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

    Sir can you make a tutorial on how to make a file uploader button in java eclipse? Btw my system is a lan messenger i just need it for my school project proposal

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

      Hey Ben! That's a good idea for a video so thanks! Do you mean you click a button and it opens the file explorer in windows or whatever OS you are using and you choose the file you want to send to the other user? I would most likely implement this with JavaFX.

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

      Yes sir!

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

      @@benswollo2050 yeah man I'll definitely make a video on that!

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

      Thank you so much sir

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

      I only use java eclipse cause thats what my teacher told because were beginners

  • @sara..4745
    @sara..4745 2 ปีที่แล้ว

    Can i have these codes

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

    Good content

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

    copy kan dulu jagultop

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

    Love you

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

    i love you

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

    Please never post a video with this screen zoom again, it's impossible to watch without hard eyes effort😵‍💫😵

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

      Hey Eril yeah I zoom in in my later videos lol

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

      ​@@WittCode Thanks so, your tutorials are amazing... and I like it

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

    hi man i love your content and i need help with java. what's your email, i would probably need help.

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

      Hey there! You can ask me questions here if you want? What are you struggling with?