Page 635 - 3-2
P. 635
{
e.printStackTrace();
}
finally
{
// acp_sock.close();
}
}
static String getTime() {
SimpleDateFormat f = new SimpleDateFormat("[hh:mm:ss]");
return f.format(new Date());
}
}
@Override
public void run()
{
// TODO Auto-generated method stub
}
}
클라이언트
/*
import java.io.*;
import java.net.*;
public class TestClient01
{
public static void main( String args[] ) throws IOException
{
BufferedReader in = new BufferedReader( new InputStreamReader( System.in ) );
Socket sock = null; // 접속할 소켓
DataInputStream din; // READ 스트림
DataOutputStream dout; // WRITE 스트림
// int recv_int; // 서버로부터 받을 변수값
String send_str = "", recv_str = ""; // 서버에게 보낼 문자열
try
{
sock = new Socket( "192.168.0.56", 60000 );
// 소켓과 스트림결합
din = new DataInputStream( sock.getInputStream() ); // READ STREAM, 서버에서 받아오는 신호
// 연결
- 635 -