JAVA服务器/客户端编程之阻塞式客户端
package my_network_test.zuse;
import java.io.*;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
public class TCPClient {
private final Socket socket;
public TCPClient() throws IOException {
int port = 4444;
String host = "localhost";
socket=new Socket(host, port);
}
public void service(){
System.out.println("客户端启动...");
try {
BufferedReader brLocal=new BufferedReader(new InputStreamRead
共有 0 条评论