×

Discussion Board

Results 1 to 4 of 4

Thread: Socket Time out

  1. #1
    Regular Contributor
    Join Date
    Nov 2007
    Location
    Moratuwa, Sri Lanka
    Posts
    86

    Socket Time out

    Hi all,

    I have a socket receive function and I want to set a custom time out value of 1000 MicroSeconds. (i.e. if a socket is not recieved within 1000 Microseconds it should go to RunL() ).

    How can this be done ?

    Regards,
    Primal

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: Socket Time out

    You have to implement a separate active object for that (containing the timer). There you can Cancel the first one (pass a reference to it), and so on. Of course the Cancel should be mutual - basically CSocketBlabla::RunL should start with iTimerActive->Cancel(), and CTimerActive::RunL should start with iSocketBlabla->Cancel().

  3. #3
    Regular Contributor
    Join Date
    Nov 2007
    Location
    Moratuwa, Sri Lanka
    Posts
    86

    Re: Socket Time out

    Hi,

    I tried the followign way having socket send is written in a one class and the timer is in another class.
    Code:
    socketCls->send();
    	TTimeIntervalMicroSeconds32 aDelay = 30000;
    	iTimer.After( iStatus, aDelay );
    	
    	if (socketCls->iStatus.Int() == 0)
    	{
    		//socketCls->Cancel();
    		
    		TBuf<128> content;
    		//content.Copy(_L("Patner is missing"));
    		content.Num(socketCls->iStatus.Int());
    		CEikonEnv::InfoWinL(_L(" -- // -- value is "),content);	
    	}
    But when the timer expires (after 300000 micro seconds), the whole program get closed. What could be the reason ?

    Regards,
    Primal

  4. #4
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Socket Time out

    Your application panics so all you have to do is retrieve the panic reason and code and then identify and fix the problem.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

Similar Threads

  1. socket connection breaks after some time
    By p_joon in forum Mobile Java General
    Replies: 3
    Last Post: 2008-06-14, 16:48
  2. Date & Time Editor in Form Resource.
    By Kavit Patel in forum Symbian
    Replies: 2
    Last Post: 2008-03-03, 06:26
  3. SOCKET PROGRAMMING: Client can not connect to server...
    By simbiyan in forum Symbian Networking & Messaging (Closed)
    Replies: 5
    Last Post: 2007-04-22, 20:00
  4. Replies: 1
    Last Post: 2006-12-12, 13:50
  5. bluetooth socket and regisry it
    By Serhio in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-02-15, 08:03

Posting Permissions

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