0

How do I handle multiple clients in Java without getting "connection refused" error?

Jonas
  • 109,920
  • 93
  • 295
  • 369
Dinesh
  • 169
  • 1
  • 7

3 Answers3

1

This is an older post of mine.. I hope it can help you a bit. It is a small app with a server and 3 clients. Every time a client sends a message to the server, the server sends it to the rest of the clients

Community
  • 1
  • 1
C.L.S
  • 1,267
  • 2
  • 17
  • 31
  • Thank you very much guys.... I just cleared that problem by simply making the server "up" always henceforth it can listen multiple clients request. – Dinesh Nov 21 '11 at 06:21
1

You could use a library QuickServer; it will make your life much easier, since this is cookie cutter code. QuickServer will take care of setting up and managing your threads.

trashgod
  • 200,320
  • 28
  • 229
  • 974
Andres Olarte
  • 4,300
  • 3
  • 22
  • 45
-1

By creating a multithreaded server: Google

Lukas Knuth
  • 25,069
  • 15
  • 82
  • 110