Tikvesa Posted March 20, 2023 Share Posted March 20, 2023 So i was using this tutorial from dreameo that i found on a forum but i dont know how to implement thread into it. My script just accepts one request and then just ignores new listener when it comes to it. Can someone help? Quote Link to comment Share on other sites More sharing options...
Gunman Posted March 20, 2023 Share Posted March 20, 2023 4 hours ago, Tikvesa said: So i was using this tutorial from dreameo that i found on a forum but i dont know how to implement thread into it. My script just accepts one request and then just ignores new listener when it comes to it. Can someone help? Need a better description of the issue you're having 1 Quote Link to comment Share on other sites More sharing options...
Tikvesa Posted March 20, 2023 Author Share Posted March 20, 2023 (edited) 7 hours ago, Gunman said: Need a better description of the issue you're having So i implemented this into my script (its part of the script that runes in loop): public class Test { public static void main(String[] args) throws InterruptedException { Server server = new Server(50000); server.listen(); server.write("Hello peasant"); } } And it works as intended for the first request. Then it goes to the rest of the script but when it comes back to that part and when it need to listen for a new request again it just ignores whole thing and it doesnt listen for a new request. I found on a web to add thread into all this but i tried all day today and i dont know how Edited March 20, 2023 by Tikvesa Quote Link to comment Share on other sites More sharing options...
Gunman Posted March 21, 2023 Share Posted March 21, 2023 19 hours ago, Tikvesa said: So i implemented this into my script (its part of the script that runes in loop): public class Test { public static void main(String[] args) throws InterruptedException { Server server = new Server(50000); server.listen(); server.write("Hello peasant"); } } And it works as intended for the first request. Then it goes to the rest of the script but when it comes back to that part and when it need to listen for a new request again it just ignores whole thing and it doesnt listen for a new request. I found on a web to add thread into all this but i tried all day today and i dont know how You need to look up a simple java client and server socket tutorial and then look up multithreading for it as well Quote Link to comment Share on other sites More sharing options...