import java.io.*;
import java.net.*;
import java.util.*;
class FileName implements FilenameFilter
{
String str=null;
FileName (String s)
{
str="."+s;
}
public boolean accept(File dir,String name)
{
return name.endsWith(str);
}
}
public class Server
{
public static void main(String args[])
{
ServerSocket server=null;
Socket you=null;
while(true)
{
try
{
server=new ServerSocket(6666);
}
catch(IOException e1)
{
System.out.println("正在监听");
}
try {
you=server.accept();
InetAddress address=you.getInetAddress();
System.out.println("客户的IP:"+address);
}
catch (IOException e)
{
}
if(you!=null)
{
new Server_thread(you).start();
}
else {
continue;
}
}
}
}
浮云间
杨魅力
相关分类