package com.lovo.socket;
import java.io.IOException;
import java.net.*;
public class Server
{
public static void main(String[] args)
{
try {
Socket socket = new Socket("localhost",4100);
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
//OutputStream out = socket.getOutputStream();
//PrintWriter writer = new PrintWriter(new OutputStreamWriter(out));
//writer.write("hello.");
//writer.flush();
}
}
始终都有异常.
connection 拒绝.
好象是IOException.
但不知道问题出在哪.