Á¦ ¼ÒÄÏÇÁ·Î±×·¥ ¼Ò½ºÁ» ºÁ Áּſä


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]

±Û¾´ÀÌ :ÀÌÈ£¿¬ 2000³â 3¿ù 06ÀÏ 16:28:01

¾È³çÇϼ¼¿ä
¼ÒÄÏÀ»ÀÌ¿ëÇÑ ¼­¹ö¿ÍÀÇ ÀÀ´äÀ» Å×½ºÆ®Çϱâ À§ÇÑ
ÇÁ·Î±×·¥Àä
¾Æ·¡ÀÇ Å¬¶óÀ̾ðÆ®Áß¿¡¼­
o.writeUTF (string);À̺κп¡¼­ ¼­¹ö·Î ³Ñ±âÁö¸¦
¸øÇÏ´Â°Í °°Àºµ¥..
¹®¹ýÀº ¾Æ¹«¸® ºÁµµ ÀÌ»ó¾÷´Â°Í °°Àºµ¥
¿Ö±×·±°ÅÁÒ?
±×¸®±¸ ¼­¹öÄֿܼ¡¼­´Â ´ÙÀ½°ú °°Àº ¿¡·¯°¡
¶ß°Åµç¿ä


java.net.SocketException: Connection reset by peer: JVM_recv in socket input str
eam read
at java.net.SocketInputStream.socketRead
.......


------------¼Ò½º-----------
import java.net.*;
import java.net. Socket;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class MdbClientT extends Applet implements Runnable {
DataInputStream i;
DataOutputStream o;
java.awt.TextArea output;
java.awt.TextField input;
Thread listener;



public void init(){
// super.init();
setBackground(Color.green);
setLayout (new BorderLayout ());
// add (output = new TextArea ());
add ("Center", output = new java.awt.TextArea ());
// output.setBounds(30,30,50,100);
output.setEditable (false);
add ("South", input = new java.awt.TextField ());
// pack ();
show (); //ÄÞÆÛ³ÍÆ® º¸ÀÓ
//input.setVisible(true);
input.requestFocus ();
java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
input_actionPerformed(e);
}
});

String host="localhost";
int port=3311;
try{
Socket s = new Socket(host, port);
new MdbClient ( s.getInputStream (),
s.getOutputStream ());
} catch (IOException e)
{ System.out.println (e.getMessage() );}
//"SQL Explorer " + args[0] + ":" + args[1],
}
// SQL ClientâÀÇ Å¸ÀÌƲ°ú Input ½ºÆ®¸², Output½ºÆ®¸²À» Àμö·Î ¹Þ´Â´Ù.
public MdbClientT ( InputStream i, OutputStream o) {
// super (title); this.i = new DataInputStream (new BufferedInputStream (i));
this.o = new DataOutputStream (new BufferedOutputStream (o));
// setLayout (null);


listener = new Thread (this);
listener.start ();
}
public void run () {
try { // ¹«ÇÑ·çÇÁ(¿¹¿Ü »óȲ ¹ß»ý Àü±îÁö)
while (true) {
// modified UTF-8 Çü½ÄÀ¸·Î Àо UNICODE ¹®ÀÚ¿­À» º¸³»ÁØ´Ù.
String line = i.readUTF (); // ÀоîÁø ¹®ÀÚ¿­À» â¿¡ ¾´´Ù.
output.append (line + "\n"); //ÅؽºÆ®¿¡¸®¾î.ºÙÀÓ
}
} catch (IOException ex)
{ ex.printStackTrace (); } finally { listener = null;
input.setVisible(false);
validate ();
try { o.close (); }
catch (IOException ex) {
ex.printStackTrace (); } } }
// À̺¥Æ® Çڵ鸵 ºÎºÐ


void input_actionPerformed(ActionEvent event)
{
String string;
string=input.getText();//¹®ÀÚ¿­ À» ¾ò´Â´Ù
try{
o.writeUTF (string);
o.flush ();
} catch (IOException ex) {
ex.printStackTrace();
listener.stop (); }
input.setText ("");
setVisible (false);
}}









´ÙÀ½ ±Ûµé:



À̾ ±Û¿Ã¸®±â(´äÇϱâ)

À̸§:
E-Mail:
Á¦¸ñ:
³»¿ë:
HTML ÅÂ±× Æ÷ÇÔ ¿©ºÎ: HTML ¹®¼­ÀÏ °æ¿ì üũ
°ü·Ã URL(¼±ÅÃ):
URL Á¦¸ñ(¼±ÅÃ):
°ü·Ã À̹ÌÁö URL:


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]