在TCP协议读取的时候发生了I/O异常~~~~???

解决方案 »

  1.   

    在TCP协议读取的时候发生了I/O异常~~~~???
      

  2.   

    就看这个异常什么都看不出来,更别说解决问题了我猜想是Socket的问题,可能是客户端关闭了连接
      

  3.   

            try
            {
    String url="socket://192.168.0.173:3085";
    conn = (StreamConnection)Connector.open(url);
    out = new PrintStream(conn.openOutputStream());
    in = conn.openInputStream();
            }
            catch(Exception e)
            {
                System.out.println("连接服务器的异常: "+e.toString());
            }
    //连接这里没有异常
    out.write(byte[] sendbuff);
    out.flush();
    //发送数据没有异常
                               (byte)in.read();
    //只有这里了
    还有就是,如果我把服务器重起一下就好了。但是问题不久又会出现,服务器是用.net做的
      

  4.   

    (byte)in.read();
    //异常就出现在接收数据这里,别的我什么也没有做啊
      

  5.   

    对了忘记说了,我做的是基于j2me的应用程序。
    这是在用手机模拟器调试的时候的异常!
      

  6.   

    确定3085端口有TCP协议的服务在侦听吗?
      

  7.   

    Question/Problem: Connection reset by peer. Answer/Solution: A connection was forcibly closed by a peer. This normally results from a loss of the connection on the remote socket due to a timeout or a reboot. User suggestions: Some network systems have commands to report statistics. In this case, it might be possible to check the count of TCP RST packets received, or ICMP Port Unreachable packets. See other suggestions under WSAECONNABORTED. 
    这些话是什么意思啊?
      

  8.   

    darkattack(居士) 
    我是开了一个线程来侦听这个 端口的,没有 问题的!