Java Socket Programming 3 - Interactive single client server

  Рет қаралды 29,419

David Dobervich

David Dobervich

Күн бұрын

In which we make a server that can have an interactive session with a single client.

Пікірлер: 15
@Rockyzach88
@Rockyzach88 Жыл бұрын
So I figured out my issue with trying to make this work after watching the video. I had left my JOptionPane line in there which I think it is hanging up the "command" loop. After doing some searching and chatting with gpt, apparently you are supposed to create what's called an Event Dispatch thread (EDT) for GUI elements such as JOptionPane. This is done with something called SwingUtilities. He might explain this in the next video but for anyone else who might be following along and made the same mistake, make sure to look into that.
@kbdawg1000
@kbdawg1000 4 жыл бұрын
Quick question, why did you choose not to close the listener and client socket in the server? I see you closed the streams but not the sockets, why?
@ddobievich
@ddobievich 4 жыл бұрын
Not closing the sockets wasn't a decision but an oversight. Thanks for flagging it! I'll revise this when we cover it again the course I'm teaching.
@vincinoyb9734
@vincinoyb9734 4 жыл бұрын
Nice explanation, thanks! Same problem as Kebrom below, I am missing the closure of open ports in this part (3). It works once and then it crashes at startup due to remaining open ports. Also typing 'quit' in the client is a problem. This returns a null value to to server (request var) which is not a string, therefor request.contains("name") fails with a NullPointerException. Maybe this will all be clear in part 4, but before I continue I want to fix (and understand) the 'little' problems before they become big problems... Also a copy of the (working) code fragments (in github or here in the comments) would be very appreciated!
@ddobievich
@ddobievich 4 жыл бұрын
Yea, I hear it. I made this kind of quickly for a high school class I teach and I didn't want to provide code for them because I wanted them to make it for themselves. I'll probably revisit this later in the year when we do it again and I'll address some of the questions here. Sorry for the long wait, but making teaching materials takes a long time and I'm teaching 3 different courses that need daily production right now.
@vincinoyb9734
@vincinoyb9734 4 жыл бұрын
@@ddobievich Well, I like it and it helped me a lot on my way to make a highscore server. Thanks for your time and effort!
@elbozo5723
@elbozo5723 3 жыл бұрын
lucky students, my high school java teacher was some shitty website
@vibhashreehippargi8233
@vibhashreehippargi8233 2 жыл бұрын
i fixed it like this in dateserver.java. Is it okay? if(request==null) { break; } else if(request.contains("name")) { . . . .
@mohammad-karbalaee
@mohammad-karbalaee 3 жыл бұрын
thanks a lot
@chivonchhai-IT
@chivonchhai-IT 5 жыл бұрын
Good Video
@LennoxHaynes21
@LennoxHaynes21 5 жыл бұрын
Where can this code be found? edit: So there are a bunch of comedians under my comment I see....
@alejandroluisjaviergutierr1847
@alejandroluisjaviergutierr1847 4 жыл бұрын
In the video :v
@techappleteja8564
@techappleteja8564 4 жыл бұрын
in Java
@uclocnguyenvo422
@uclocnguyenvo422 4 жыл бұрын
in his computer :v
@bendywills859
@bendywills859 4 жыл бұрын
69 likes
Java Socket Programming 4 - Multi-client interactive sessions
23:17
David Dobervich
Рет қаралды 145 М.
Java Socket Programming Client Server Messenger
16:28
WittCode
Рет қаралды 113 М.
Боксёр воспитал дикого бойца!
01:36
МИНУС БАЛЛ
Рет қаралды 4,9 МЛН
When ur grandma sneaks u money
00:32
Adam W
Рет қаралды 19 МЛН
Версия без цензуры в 🛒 МИРАКЛЯНДИЯ
00:47
And what’s your height? 😁 @karina-kola
00:10
Andrey Grechka
Рет қаралды 52 МЛН
Java Socket Programming Part 1
14:46
David Dobervich
Рет қаралды 45 М.
Java Socket Programming 2 - Single interaction single client
10:59
David Dobervich
Рет қаралды 30 М.
Java Socket Programming - Multiple Clients Chat
40:18
WittCode
Рет қаралды 192 М.
Socket Programming in Java One Way
12:01
Telusko
Рет қаралды 183 М.
Factory Pattern in Java: Creating Objects with Ease
13:53
campbelltech
Рет қаралды 8 М.
15 Years Writing C++ - Advice for new programmers
4:04
SyncMain
Рет қаралды 1,3 МЛН
How to Crack Software (Reverse Engineering)
16:16
Eric Parker
Рет қаралды 905 М.
What is a ServerSocket?
3:17
Abhay Redkar Academy
Рет қаралды 78 М.
JavaScript Crash Course For Beginners
1:40:30
Traversy Media
Рет қаралды 4,1 МЛН
Боксёр воспитал дикого бойца!
01:36
МИНУС БАЛЛ
Рет қаралды 4,9 МЛН