connection reset by peer <<<이 에러가 뜨는 데, 이게 연결상태가 리셋되어서, 끊어진거라고 들은 거 같은 데요. 현재 코드에서는 서버에 소켓접속하고, 프로그램실행시 바로 한번 읽고, 4개가 송신되고 그다음에 바로 저 에러가 뜨는 데요. 제 코드에 문제가 있는 건가요. 아님 서버에 문제가 있는 건가요. 조언과 설명 관심 제발 부탁드립니다.ㅜㅜ 현재 갤럭시 탭에 연결해서 와이파이망에서 해보았구요. Echoserver라는 현재 저희 회사에서 개발한 서버인데요. 이 서버는 접속한 기계에 ip와 port를 넘겨주는 방식입니다. 그래서 소스 내용은 EchoServer라는 곳에 소켓접속을 하여서, 4개의 텍스트박스의 정보를 버튼을 눌러서 보내고 ip와 port를 받아서 마지막 텍스트박스에서 출력하는 프로그램입니다. 현재 소스내의 에러는 수정했으며, 더 수정할 곳이 있는 지 찾아보고 있습니다만 더 몰 고쳐야 될 지는 잘 모르겠습니다. 프로그램에 대해 박학다식하신분들 제발 도와주세요. 도대체 이런 에러가 왜 자꾸 나는 지 모르겠습니다. 소스 및 에러캡쳐는 따로 위에 추가하였고, 이 곳에도 적어 올리겠습니다. 많은 도움 부탁드립니다..ㅜ 주석처리한 곳은 혹시 몰라 놔둔 것 입니다.
 
----------------------------------------소스-----------------------------------------------------
package net.npaka.echoserver;
import android.app.*;
import android.content.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import java.io.*;
import java.net.*;
import java.util.*;
import android.util.*;

public class Echoserver extends Activity implements View.OnClickListener{
 private final String IP = "192.168.0.130";
 private Echoserver current;
 private String Receive1;
 private EditText edit1,edit2,edit3,edit4;
 private Button btn;
 
 private Socket socket;
 private InputStream in;
 private OutputStream out;
 
 
 private final Handler handler=new Handler();
 private EditText txtReceive;
 
 private String getLocalIpAddress() {
  try {
   for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
    NetworkInterface intf = en.nextElement();
    for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
     InetAddress inetAddress = enumIpAddr.nextElement();
     if (!inetAddress.isLoopbackAddress()) {
      return inetAddress.getHostAddress().toString();
     }
    }
   }
  } catch (SocketException ex) {
   Log.e("address", ex.toString());
  }
  return toString();
 }
  
  @Override
    public void onCreate(Bundle savedInstanceState) {
   
  super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        current=this;
      
        edit1 = (EditText)findViewById(R.id.edit1);
        edit2 = (EditText)findViewById(R.id.edit2);
        edit3 = (EditText)findViewById(R.id.edit3);
        edit4 = (EditText)findViewById(R.id.edit4);
        txtReceive = (EditText)findViewById(R.id.edit5);
        btn = (Button)findViewById(R.id.btn);
  btn.setOnClickListener(this);
  
  edit3.setText(edit3.getText().toString()+getLocalIpAddress());
  (new Thread(){public void run() {
   try {
     connect(IP,19090);
     } catch (Exception e) {
      Log.e("","connected errosss " + e.getMessage());
      handler.post(new Runnable(){
       public void run() {
        Echoserver.showDialog(current,"","쓰레드에러라고.");
       }
      });}
    }}).start();   
  }
  
 
 private void connect(String ip,int port) {
  
  int size;
  byte[] w=new byte[1024];
  Receive1 = "";
   try {
   
   socket=new Socket(ip,port);
   in =socket.getInputStream();
   out=socket.getOutputStream();
   
   Log.e("","read w");
   size=in.read(w);
   Log.e("","read end");
    Receive1=new String(w,0,size,"UTF-8");
     handler.post(new Runnable(){
     public void run() {
      txtReceive.setText(
        txtReceive.getText()+Receive1);
     }
    });
   
  } catch (Exception e) {
   
   Log.e("","connected errosss " + e.getMessage());
   handler.post(new Runnable(){
    public void run() {
     Echoserver.showDialog(current,"","콘넥트에러.");
    }
   });
  }
 }
 public void onClick(View v) {
  if (v.getId() == R.id.btn) {
  
   try {
        
    if (socket!=null && socket.isConnected()) {
     
     byte[] a=edit1.getText().toString().getBytes("UTF8");
     byte[] b=edit2.getText().toString().getBytes("UTF8");
     byte[] c=edit3.getText().toString().getBytes("UTF8");
     byte[] d=edit4.getText().toString().getBytes("UTF8");
     Log.e("","write a");
     out.write(a);
     Log.e("","WRITE B");
     out.write(b);
     Log.e("","WRITE C");
     out.write(c);
     Log.e("","WRITE ");
     out.write(d);
     Log.e("","WRITE B");
    }
  } catch (Exception e) {
   
   Log.e("","clack erroerr" + e.getMessage());
   handler.post(new Runnable(){
    public void run() {
     Echoserver.showDialog(current,"","클릭에러 .");
    }
   });
  }
 }

 public static void showDialog(final Activity activity,String title,String text) {
  AlertDialog.Builder ad=new AlertDialog.Builder(activity);
  ad.setTitle(title);
  ad.setMessage(text);
  ad.setPositiveButton("OK",new DialogInterface.OnClickListener() {
   public void onClick(DialogInterface dialog,int whichButton) {
    activity.setResult(Activity.RESULT_OK);
   }
  });
  }
}
--------------------------------------------xml------------------------------------------<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="
http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:id="@+id/linearLayout1">
        <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/text1"
        android:text="Echo Server IP"
        ></TextView>
        <EditText
  android:text=""
  android:id="@+id/edit1"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     ></EditText>
    </LinearLayout>
   
    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:id="@+id/linearLayout2">
        <TextView
        android:text="Echo Server Port"
        android:id="@+id/text2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ></TextView>
        <EditText
        android:layout_width="fill_parent"
        android:id="@+id/edit2"
        android:layout_height="wrap_content"
        android:text=""></EditText>
    </LinearLayout>
   
    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:id="@+id/linearLayout3">
        <TextView
        android:text="My Local IP"
        android:id="@+id/text3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ></TextView>
        <EditText
        android:layout_width="fill_parent"
        android:id="@+id/edit3"
        android:layout_height="wrap_content"
        android:text=""
        ></EditText>
    </LinearLayout>
   
    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:id="@+id/linearLayout4">
        <TextView
        android:text="My Local Port"
        android:id="@+id/text4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ></TextView>
        <EditText
        android:layout_width="fill_parent"
        android:id="@+id/edit4"
        android:layout_height="wrap_content"
        android:text=""
        ></EditText>
    </LinearLayout>
   
    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:id="@+id/linearLayout5">
        <TextView
        android:text="My Public IP 와 My Public PORT(아래참조)"
        android:id="@+id/text5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ></TextView>
       
    </LinearLayout>
    <EditText
        android:layout_width="fill_parent"
        android:id="@+id/edit5"
        android:layout_height="wrap_content"
        android:text=""
        ></EditText>
    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:id="@+id/linearLayout6">
       
    </LinearLayout>
    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:id="@+id/linearLayout7">
        <Button
        android:text="Button"
        android:id="@+id/btn"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        ></Button>
    </LinearLayout>
</LinearLayout>
-------------------------------------Androidmanifest--------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="
http://schemas.android.com/apk/res/android"
      package="net.npaka.echoserver"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="4" />
    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:permission="android.permission.INTERNET">
        <activity android:name="Echoserver"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>