3

I am trying out a simple socket programming example. I was able to run a server application and client application to communicate with each other. I now need to know a tutorial that explains how 2 clients could communicate with each other through the server.

How can I do this ? Can someone point me to a good tutorial or an explanation on how this can be done in Java

kamaci
  • 72,915
  • 69
  • 228
  • 366
user1315906
  • 3,374
  • 8
  • 30
  • 43

1 Answers1

1

It's not that different and difficult than writing client/server pair. You just have to create threads on server just there, where you accept connections from clients. If your clients should communicate each other, than you surely need a list to store them. And you have to implement, what your server does (communication) in this thread.

Here is a good chat programm tutorial: http://www.dreamincode.net/forums/topic/259777-a-simple-chat-program-with-clientserver-gui-optional/

leventcinel
  • 358
  • 2
  • 5