Send data from server to multiclient

ServerSocket s =new ServerSocket(9999);

Socket incoming = s.accept();

BufferedReader data_in =new BufferedReader(new InputStreamReader(incoming.getInputStream()));

PrintWriter data_out =new PrintWriter(incoming.getOutputStream());

data_out.println("connected");

data_out.flush();

the data_out.println

will send the data to all connected client right?

[560 byte] By [gracecheaha] at [2007-11-27 8:14:25]
# 1
No, it will send data to the single client that is connected with that socket.Read the tutorials.
-Kayaman-a at 2007-7-12 19:58:58 > top of Java-index,Java Essentials,Java Programming...
# 2
> No, it will send data to the single client that is> connected with that socket.> > Read the tutorials.thanks..if the server is connected with multi client using same port.. then the data also will send to single client?
gracecheaha at 2007-7-12 19:58:58 > top of Java-index,Java Essentials,Java Programming...
# 3
The server socket is listening on one port, when a client connects to it a Socket is created. There is one socket per client, so you need to send all the connected sockets the data if you want everyone to get them.
-Kayaman-a at 2007-7-12 19:58:58 > top of Java-index,Java Essentials,Java Programming...
# 4
ok. thanks a lot
gracecheaha at 2007-7-12 19:58:58 > top of Java-index,Java Essentials,Java Programming...