?? client.java
字號:
import java.net.*;
import java.io.*;
public class Client
{
public static void main(String []args) throws Exception
{
try
{
File f= new File("121.jpg");
FileInputStream in = new FileInputStream(f);
Agent agent = new Agent(in.available());
agent.readPic(in);
in.close();
agent.gotoNextHost();
ServerSocket s = new ServerSocket(8002);
System.out.println("");
System.out.println("This is the Source!");
System.out.print("Waiting for Agent come back....");
Socket backToClient = s.accept();
System.out.println("Agent Return!");
ObjectInputStream ois = new ObjectInputStream(
backToClient.getInputStream());
Agent backagent = (Agent)ois.readObject();
backagent.viewInformation();
backToClient.close();
s.close();
}
catch(IOException ex)
{
System.err.println(ex);
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -