1HashMap的遍历向每一个socket发送数据
public HashMap<String, Socket> sockets = new HashMap();
try {
Set<String>set=sockets.keySet();
Iterator<String>it=set.iterator();
while(it.hasNext()){
OutputStream os = socket.getOutputStream();
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));
String words = textArea.getText();
System.out.println("服务器发送信息");
bw.write(words + "\n&