freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java2實用教程第5版習(xí)題解答-資料下載頁

2025-03-24 04:56本頁面
  

【正文】 while(true) { try{ server=new ServerSocket(4331)。 } catch(IOException e1) { (正在監(jiān)聽)。 //ServerSocket對象不能重復(fù)創(chuàng)建 } try{ ( 等待客戶呼叫)。 you=()。 (客戶的地址:+())。 } catch (IOException e) { (正在等待客戶)。 } if(you!=null) { new Server_thread(you).start()。 //為每個客戶啟動一個專門的線程 } } }}class Server_thread extends Thread{ Socket socket。 DataOutputStream out=null。 DataInputStream in=null。 String s=null。 boolean quesion=false。 Server_thread(Socket t) { socket=t。 try { out=new DataOutputStream(())。 in=new DataInputStream(())。 } catch (IOException e) {} } public void run() { while(true) { double a[]=new double[3] 。 int i=0。 try{ s=()。//堵塞狀態(tài),除非讀取到信息 quesion=false。 StringTokenizer fenxi=new StringTokenizer(s, ,)。 while(()) { String temp=()。 try{ a[i]=(temp).doubleValue()。i++。 } catch(NumberFormatException e) { (請輸入數(shù)字字符)。 quesion=true。 } } if(quesion==false) { double p=(a[0]+a[1]+a[2])/。 ( +(p*(pa[0])*(pa[1])*(pa[2])))。 } } catch (IOException e) { (客戶離開)。 return。 } } } }2. import .*。import .*。import .*。import .*。import .*。 public class Client{ public static void main(String args[]) { new ChatClient()。 }}class ChatClient extends Frame implements Runnable,ActionListener{ Button connection,send。 TextField inputName,inputContent。 TextArea chatResult。 Socket socket=null。 DataInputStream in=null。 DataOutputStream out=null。 Thread thread。 String name=。 public ChatClient () { socket=new Socket()。 Box box1=()。 connection=new Button(連接服務(wù)器)。 send=new Button(發(fā)送)。 (false)。 inputName=new TextField(6)。 inputContent=new TextField(22)。 chatResult=new TextArea()。 (new Label(輸入妮稱:))。 (inputName)。 (connection)。 Box box2=()。 (new Label(輸入聊天內(nèi)容:))。 (inputContent)。 (send)。 (this)。 (this)。 thread=new Thread(this)。 add(box1,)。 add(box2,)。 add(chatResult,)。 setBounds(10,30,400,280)。 setVisible(true)。 validate()。 addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { (0)。 } })。 } public void actionPerformed(ActionEvent e) { if(()==connection) { try { if(()) {} else { InetAddress address=()。 InetSocketAddress socketAddress=new InetSocketAddress(address,666)。 (socketAddress)。 in =new DataInputStream(())。 out = new DataOutputStream(())。 name=()。 (姓名:+name)。 (true)。 if(!(())) thread=new Thread(this)。 ()。 } } catch (IOException ee){} } if(()==send) { String s=()。 if(s!=null) { try { (聊天內(nèi)容:+name+:+s)。 } catch(IOException e1){} } } } public void run() { String s=null。 while(true) { try{ s=()。 (\n+s)。 } catch(IOException e) { (與服務(wù)器已斷開)。 try { ()。 } catch(Exception exp) {} break。 } } }}import .*。import .*。import .*。public class ChatServer { public static void main(String args[]) { ServerSocket server=null。 Socket you=null。 Hashtable peopleList。 peopleList=new Hashtable()。 while(true) { try { server=new ServerSocket(666)。 } catch(IOException e1) { (正在監(jiān)聽)。 } try { you=()。 InetAddress address=()。 (客戶的IP:+address)。 } catch (IOException e) {} if(you!=null) { Server_thread peopleThread=new Server_thread(you,peopleList)。 ()。 } else { continue。 } } }}class Server_thread extends Thread{ String name=null。 Socket socket=null。 File file=null。 DataOutputStream out=null。 DataInputStream in=null。 Hashtable peopleList=null。 Server_thread(Socket t,Hashtable list) { peopleList=list。 socket=t。 try { in=new DataInputStream(())。 out=new DataOutputStream(())。 } catch (IOException e) {} } public void run() { while(true) { String s=null。 try{ s=()。 if((姓名:)) { name=s。 boolean boo=(name)。 if(boo==false) { (name,this)。 } else { (請換妮稱:)。 ()。 break。
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1