java.net 操练__教程 |
|
日期:2007-5-20 1:27:33 人气:164 [大 中 小] |
|
|
|
}
/** * */ private void getStreams() throws IOException { // TODO Auto-generated method stub output=new ObjectOutputStream(client.getOutputStream()); output.flush(); input=new ObjectInputStream(client.getInputStream()); infBox.append("get the IO Stream..\n");
}
/** * */ private void connectToServer() throws IOException { // TODO Auto-generated method stub infBox.append("try connecting to server...\n"); client=new Socket(InetAddress.getByName(chatServer),5000); infBox.append("connect to server:"+client.getInetAddress().getHostName()+"\n");
}
public static void main(String[] args) { client p; if(args.length==0) p=new client("127.0.0.1"); else p=new client(args[0]); p.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); p.runClient();
} } |
|
出处:本站原创 作者:佚名 |
|
|