2014--9=17 软工二班 MyEclipse blue==1

package cn.rwkj.test;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket; public class TestSocket {
private Socket sock=null ;
private static ServerSocket server =null;
private static int port=8080 ; public TestSocket() { //定义一个方法 try {
System.out.println("a"); server=new ServerSocket(port);
sock server.accept(); System.out.println("b"); } catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} } public static void main(String []args){
new TestSocket();
} public Socket getSock() {
return sock;
}
public void setSock(Socket sock) {
this.sock = sock;
}
public ServerSocket getServer() {
return server;
}
public void setServer(ServerSocket server) {
this.server = server;
} }

2014--9=17 软工二班  MyEclipse  blue==12014--9=17 软工二班  MyEclipse  blue==1

上一篇:C# ACCESS数据库操作类


下一篇:【转发】构建高可伸缩性的WEB交互式系统(下)