×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    16

    java.net.SocketTimeoutException: Read timed out

    Hi all

    I am trying to trasfer some data (more than 300K) from mobile phone to the web server and i am getting java.net.SocketTimeoutException: Read timed out exception on the server side. I am using DataOutputStream and DataInputStream. Can anyone help me regarding this problem how can i get rid of this exception?

    Regards

  2. #2
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699

    Re: java.net.SocketTimeoutException: Read timed out

    hi,

    have you tried to setup init params for servlet? (in web.xml init-param for timeout)

    regards,
    Peter

  3. #3
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: java.net.SocketTimeoutException: Read timed out

    Have you tried with really small amout of data first? Like a couple tens of bytes? does that work?

    Hartti

  4. #4
    Registered User
    Join Date
    Feb 2006
    Posts
    16

    Re: java.net.SocketTimeoutException: Read timed out

    NO i am not able to transfer even small data. For even small data if gives this exception on the server end.

    Also init-param in web.xml whcih particular occurance there are about 10 occurances of this tag.

  5. #5
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699

    Re: java.net.SocketTimeoutException: Read timed out

    hi,

    does your:

    servlet contain a code like that one:
    Code:
      public void doPost(HttpServletRequest request,
                         HttpServletResponse response)
                  throws ServletException, IOException {
    
        response.setContentType("application/binary");
    
        InputStream in = request.getInputStream();
        OutputStream out = response.getOutputStream();
        DataInputStream din = new DataInputStream(in);
        DataOutputStream dout = new DataOutputStream(out);
       ......
    midlet:
    Code:
    dout = conn.openDataOutputStream ();
    .......
    dout.write (byteData, 0, byteData.length);
    ....
    dout.flush ();
    dout.close ();
    regards,
    Peter

Similar Threads

  1. Socket read on Nokia 6600 blocks forever
    By delipsingh in forum Mobile Java Networking & Messaging & Security
    Replies: 9
    Last Post: 2010-04-13, 15:00
  2. Recording in Amr Format
    By losym in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2009-03-26, 06:41
  3. Replies: 0
    Last Post: 2006-06-08, 18:02
  4. socket read hangs until socket is closed
    By camroe in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-07-21, 09:44
  5. read text file
    By ivan6502 in forum Mobile Java General
    Replies: 1
    Last Post: 2005-01-17, 21:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •