0

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

Jonas
  • 121,568
  • 97
  • 310
  • 388
Dinesh
  • 189
  • 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.LS
  • 1,319
  • 2
  • 17
  • 35
  • 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
  • 203,806
  • 29
  • 246
  • 1,045
Andres Olarte
  • 4,380
  • 3
  • 24
  • 45
-1

By creating a multithreaded server: Google

Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111