【Java开源代码栏目提醒】:网学会员,鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“client1.java”一文,供大家参考学习!
import java.net.*;
import java.io.*;
public class Client1
{
public static final int DAYTIME_PORT = 13;
String host;
Socket s;
public static void main(String args[]) throws IOException
{
Client1 client = new Client1("localhost");
client.go();
}
public Client1(String host)
{
this.host = host;
}
public void go() throws IOException
{
s = new Socket(host, DAYTIME_PORT);
BufferedReader i = new BufferedReader(
new InputStreamReader(s.getInputStream()));
System.out.println(i.readLine());
i.close();
s.close();
}
}
上一篇:
Client.java
下一篇:
餐饮管理系统