×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    86

    IOException in Socket program

    Hi

    i am doing one project using socket programming its like communication b/w mobile browser and main server(mean like google,yahoo,.....etc) using my application.In my project i am getting this error "java.io.ioexception error 10054 tcp read" while sending back response to my mobile browser.

    can u help me Y it is coming like this io error in my project.

    thanks a lot
    mottaisami

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

    Re: IOException in Socket program

    hi,

    by socket do you mean SocketConnection? or just tcp/ip?
    in the latter case see that thread:
    http://discussion.forum.nokia.com/fo...ad.php?t=45158
    maybe it will be usefull,

    regards,
    Peter

  3. #3
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    86

    Re: IOException in Socket program

    hi
    I am using socket connection only.
    In emulator itself this ioexception is coming,but the pages are getting displayed properly.

    I installed my program in mobile and tried to connect to the internet via a proxyserver,then the wap browser is not getting connected with the proxyserver till i close the wapbrowser.if i close the wapbrowser then the connection between wapbrowser and proxyserver is getting established.

    I put this code in the try-catch statement only
    try
    {
    String str = "socket://59.144.3.15:9393"; //here 59.144.3.15 is the machine's ip where im running the proxyserver
    s = (SocketConnection)Connector.open(str,Connector.READ_WRITE);
    /*OutStream to write the request to the proxy server*/
    out = s.openOutputStream();
    outw = new PrintStream(out);

    outw.print(requestHeader+"\r\n"); //here requestheader is the request taken from the browser and sending that to the proxyserver
    outw.print("\r\n");
    outw.flush();

    /*Inputstream to read the response from the proxy server*/
    in = new DataInputStream(s.openInputStream());
    /*writing the response in the browser added by senthil*/
    while((len = in.read(buffer))!= -1) {
    os.write(buffer, 0, len);
    }
    }finally{
    os.close();
    in.close();
    out.close();
    is.close();
    client.close();
    }
    Can anyone tell me how to connect the wap browser to the proxy server?

    Thanks a lot

  4. #4
    Registered User
    Join Date
    Jun 2006
    Posts
    8

    Re: IOException in Socket program

    Hi

    Dont know if this will be helpful. I had the same error message at one time when opening a SocketConnection.

    I experimented with SocketConnection and my method for doing the communication was creating a thread to do the opening of the outputstream and sending of data to the server.

    The main thread would wait for the created thread to finish sending (by calling the join() method) and then receive the response through the inputstream.

    not too sure if it will help you. hope it does though.
    Last edited by badquek; 2006-09-18 at 08:12.

Similar Threads

  1. problem in persistant socket connection
    By poms4symbian in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-01-03, 13:23
  2. Replies: 7
    Last Post: 2004-06-16, 09:36
  3. Program terminated when calling Connect() of a Socket class
    By windalfred0 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2004-06-16, 09:07
  4. 7650 IOException Status=-21 on socket connection
    By kimmok in forum Mobile Java General
    Replies: 2
    Last Post: 2003-07-14, 09:28

Posting Permissions

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