multiuser server problem

i am using thread run on server which server multiuser. i would like server to keep some value until all connected user send some data to server then only the server will broadcast the value to all connected user.

for example, i have 5 client connected to server. in server side, i use array list to keep IP address of connected client . all client should send "hi" to server before server broadcast "hi" to all 5 client.

the problem is, the array list just keep data for the user respectively in server. when client A connected to server, ArrayList keep client A IP. then when client B connected to server, Array List just keep client B IP where client A IP just now disappear.. any idea on where i want ArrayList will hold client A IP then client B connecting to server, IP for client C will add to Array List? anyone can help me? appreaciate

[864 byte] By [gracecheaha] at [2007-11-27 10:52:43]
# 1

intCountClientParse=0;

String strMsg = data_in.readLine();

if (strMsg .equals("hi")) {

intCountClientParse+intCountClientParse=1;

}

if (intCountClientParse==5){

//broadcast "hi" to all connected client

}

the value keep in intCountClientParse always returning to 0 on evertytime client send something to server but not keep increment. please help me up. thanks

gracecheaha at 2007-7-29 11:39:32 > top of Java-index,Java Essentials,New To Java...
# 2

You've probably got it declared in the scope of the Thread that handles the connection, when it should be declared in the scope of the class that contains the ServerSocket.

ejpa at 2007-7-29 11:39:32 > top of Java-index,Java Essentials,New To Java...
# 3

thank ^^

gracecheaha at 2007-7-29 11:39:32 > top of Java-index,Java Essentials,New To Java...