Yarden
Explore posts from serversJCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
But it seems like everything is working pretyy much alright
So thank you very much ❤️
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
Right?
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
socket = serverSocket.accept();
inputStreamReader = new InputStreamReader(socket.getInputStream()); outputStreamWriter = new OutputStreamWriter(socket.getOutputStream());
bufferedReader = new BufferedReader(inputStreamReader); bufferedWriter = new BufferedWriter(outputStreamWriter);
while(true) {
String msgFromClient = bufferedReader.readLine();
System.out.println("Client: " + msgFromClient);
bufferedWriter.write("MSG Received"); bufferedWriter.newLine(); bufferedWriter.flush();
inputStreamReader = new InputStreamReader(socket.getInputStream()); outputStreamWriter = new OutputStreamWriter(socket.getOutputStream());
bufferedReader = new BufferedReader(inputStreamReader); bufferedWriter = new BufferedWriter(outputStreamWriter);
while(true) {
String msgFromClient = bufferedReader.readLine();
System.out.println("Client: " + msgFromClient);
bufferedWriter.write("MSG Received"); bufferedWriter.newLine(); bufferedWriter.flush();
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
client or server?
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
I have InputStreamReader, the BufferedReader takes the information from the InputStreamReader.
The System.out prints in to the console no?
I'm using BufferedReader on both client and server sides
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
I mean the BufferedReader
And then the writer put it in the server's chat
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
Hmmm probably not?
Isn't it "catch" the message the client writes in the system.out?
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
Wait yes totally this
So i'm a bit confused, what exactly the use of newLine()?
I thought it take a line space
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
Or maybe am I suppose to open a new help post?
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
You are just a god
Thank you so much ❤️
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
And then i'm pressing f11 and i get an error
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
I did also
I'll show you
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
doesn't work 🫠
The port is still broken
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
fixed it thank youuu!
There is only 1 issue:
When i'm changing back the port to a port I already used before, I still got the error.
Is there a way to "free" the problematic ports?
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
Maybe I've missed something?
76 replies
JCHJava Community | Help. Code. Learn.
•Created by Yarden on 10/10/2024 in #java-help
I've created 1 client server, but everytime I'm exiting the server I can't connect anymore
The guy in the tutorial said:
* The first loop: ensures the server is constantly running.
* The second loop: ensures that, once the client is connected, the server is constantly interacting with the client until the client disconnects.
Where was he wrong?
76 replies