×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Feb 2008
    Location
    Jaipur, India
    Posts
    52

    RSocket Connectt() hangs application

    Hi
    I am developing an application using S60 3rd Ed FP1. Also this problem is on emulator.

    Im my application I am creating a socket connection and performing read and write operations on that. For socket connection, read and write operation I have three Active object. All is working fine when I use a proper IP address. Also my server application is running on a machine in LAN.

    The problem is that when I use a IP like 192.168.0.1, which in not valid for my LAN, my application hangs for a moment on Connect() method of RSocket class. Or in other word the Connect method take long time to return back control to next stametment. But at same time if I use IP, which is valid for my LAN) like 192.168.166.34 the Connect() return immediately. So my queries are

    1. Is there a way to get the UI events performed by user and application does not hang while Connect() is executing.
    2. Why Connect() takes long time when I give IP, which is not a live IP and also not valid for my LAN.

    I also tried with a live IP and found that Connect() returns properly without delay.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: RSocket Connectt() hangs application

    Have you tried on using the Connect with TRequestStatus ?

  3. #3
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: RSocket Connectt() hangs application

    because on your emulator, it use host pc route to connect server.
    if the ip is not exist on your intranet, the route will submit the ip packet to up route, until not any route known how deliver the ip packet.

    so, if 192.168.2.3 not exist.
    on windows cmd.exe, you exec
    c:\>telnet 192.168.2.3,
    you will find it will delay some seconds. it is equal your hung time in symbian.

    ps. hung the UI, it seems because you not use async connect, plase use AO with connect.
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

  4. #4
    Regular Contributor
    Join Date
    Feb 2008
    Location
    Jaipur, India
    Posts
    52

    Re: RSocket Connectt() hangs application

    Hi qxiaoyuan, thanks for clarifying the reason behind delay.

    As far as using active object. I am doing following:

    I am using a class derived from CActive class. This class is having a function to connect to server. In this function the code to connect with server is like this:

    // Set up address information
    iAddress.SetPort( KDefaultPortNumber );
    iAddress.SetAddress( aAddr );

    // Initiate socket connection
    iSocket.Connect( iAddress, iStatus );
    SetActive();

    The Connect() statement(In red color) is causing the delay, though I am using active object.

  5. #5
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: RSocket Connectt() hangs application

    this link has some discuss.

    it only occur on emulator with connect unreach ip. on target phone or reach ip will not hungup
    Last edited by qxiaoyuan; 2009-01-19 at 17:46.
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

Similar Threads

  1. J2ME connection issue!! Application hangs! Help needed!
    By nomanm in forum Mobile Java Networking & Messaging & Security
    Replies: 14
    Last Post: 2011-06-23, 14:17
  2. Launching a dialog when the application starts
    By Uriah Eisenstein in forum Symbian User Interface
    Replies: 10
    Last Post: 2009-03-31, 09:06
  3. image full screen
    By Morbidick in forum Mobile Java General
    Replies: 8
    Last Post: 2008-12-04, 04:16
  4. Application hangs on exit
    By StasV in forum Symbian
    Replies: 7
    Last Post: 2007-08-08, 11:12
  5. Replies: 1
    Last Post: 2005-12-01, 23:57

Posting Permissions

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