static List<Socket> socket;
DataOutputStream out=null;
DataInputStream in=null;
String s=null;
ServerThread(List<Socket> socketlist){
socket=socketlist;
for(int i=0;i<socket.size();i++){
try{
out=new DataOutputStream(socket[i].getOutputStream());
in=new DataInputStream(socket[i].getInputStream());
}catch(IOException e){
}
}
}
socketlist是从别的地方传过来的,现在我想用循环去写和读所有连接到服务器端的socket
out=new DataOutputStream(socket[i].getOutputStream());
in=new DataInputStream(socket[i].getInputStream());为什么socket[i].getOutputStream(),socket[i].getOutputStream()这样是错的呢? |
|