Original Post
I've been trying to figure out how to create a multi user server for quite some time now, and have kept running into the same issue - how to track and manipulate individual users.
I found a code example, and turned it into a working Client / Server chat program. Here is my version of the code for reference, and to keep this post relatively short .... http://reviewerrick.blogspot.com/2012/06/working-java-socket-server-client.html
That code creates a new thread every time some one connects to the server, and they can make their own user name.
What I have been banging my head off a wall, is there is no way that I know of, to send data to only one of the connected clients.
All processed data is sent to all clients, and as far as I know of, there are no ways to access specific users ( by name ).
The main loop is an issue, also, due to the fact I can not process anything outside of the threads.
I'd love to create a session number for each client connected, and use that to individually manipulate the users.
I've been trolling Google for a very long time now on various subjects of networking, users, and the like .... lots of information on servers, no information on individual users.
I found a code example, and turned it into a working Client / Server chat program. Here is my version of the code for reference, and to keep this post relatively short .... http://reviewerrick.blogspot.com/2012/06/working-java-socket-server-client.html
That code creates a new thread every time some one connects to the server, and they can make their own user name.
What I have been banging my head off a wall, is there is no way that I know of, to send data to only one of the connected clients.
All processed data is sent to all clients, and as far as I know of, there are no ways to access specific users ( by name ).
The main loop is an issue, also, due to the fact I can not process anything outside of the threads.
I'd love to create a session number for each client connected, and use that to individually manipulate the users.
I've been trolling Google for a very long time now on various subjects of networking, users, and the like .... lots of information on servers, no information on individual users.