Hello Java community!
My name is Brandon and i need help figuring out how to do a server for my game. My problem is when i try to make a loop for my client i have to close the socket i used to send the string and that works if i recreate the socket but after i close it i cant receive anything from the server.
So my question is what should i do? Should i try running another socket in its own instance or run two sockets at one time? but from what i understand about running two sockets is they would have to run on separate ports but i know that doesn't seem very resourceful or clean.
Anyways going back to the main question. How would i make a client and server that runs in a loop without having to destroy the sockets. if I'm doing it wrong and should not be running it in a loop at all or something like that please let me know.
Thank You, Brandon
PS, I'm not posting the code because i am absolutely sure it is worthless. I'm kinda a newb at this network stuff in java