In which we make a server that can have an interactive session with a single client.
Пікірлер: 15
@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.
@kbdawg10004 жыл бұрын
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?
@ddobievich4 жыл бұрын
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.
@vincinoyb97344 жыл бұрын
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!
@ddobievich4 жыл бұрын
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.
@vincinoyb97344 жыл бұрын
@@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!
@elbozo57233 жыл бұрын
lucky students, my high school java teacher was some shitty website
@vibhashreehippargi82332 жыл бұрын
i fixed it like this in dateserver.java. Is it okay? if(request==null) { break; } else if(request.contains("name")) { . . . .
@mohammad-karbalaee3 жыл бұрын
thanks a lot
@chivonchhai-IT5 жыл бұрын
Good Video
@LennoxHaynes215 жыл бұрын
Where can this code be found? edit: So there are a bunch of comedians under my comment I see....