Ignore:
Timestamp:
Mar 2, 2009 3:48:45 PM (12 years ago)
Author:
nanang
Message:

Ticket #732:

  • Added new Symbian specific API in PJLIB, pj_symbianos_set_connection_status(), to let PJLIB knows the connection status.
  • Added connection status checks before Symbian socket operations.
  • Added loop limiter in Symbian busy_sleep() to avoid the possibility of infinite loop.
  • Added sample of connection monitor in Symbian sample application (ua.cpp).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/sock_symbian.cpp

    r2394 r2481  
    464464        THostName tmpName; 
    465465 
     466        // Return empty hostname if access point is marked as down by app. 
     467        PJ_SYMBIAN_CHECK_CONNECTION2(&hostname); 
     468 
    466469        resv.GetHostName(tmpName, reqStatus); 
    467470        User::WaitForRequest(reqStatus); 
     
    489492    PJ_ASSERT_RETURN(p_sock!=NULL, PJ_EINVAL); 
    490493 
     494    // Return failure if access point is marked as down by app. 
     495    PJ_SYMBIAN_CHECK_CONNECTION(); 
     496     
    491497    /* Set proto if none is specified. */ 
    492498    if (proto == 0) { 
     
    643649    PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); 
    644650 
     651    // Return failure if access point is marked as down by app. 
     652    PJ_SYMBIAN_CHECK_CONNECTION(); 
     653     
    645654    CPjSocket *pjSock = (CPjSocket*)sock; 
    646655    RSocket &rSock = pjSock->Socket(); 
     
    679688    PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); 
    680689 
     690    // Return failure if access point is marked as down by app. 
     691    PJ_SYMBIAN_CHECK_CONNECTION(); 
     692     
    681693    CPjSocket *pjSock = (CPjSocket*)sock; 
    682694    RSocket &rSock = pjSock->Socket(); 
     
    717729    PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); 
    718730    PJ_ASSERT_RETURN(*len > 0, PJ_EINVAL); 
     731 
     732    // Return failure if access point is marked as down by app. 
     733    PJ_SYMBIAN_CHECK_CONNECTION(); 
    719734 
    720735    CPjSocket *pjSock = (CPjSocket*)sock; 
     
    771786    PJ_ASSERT_RETURN(*len > 0, PJ_EINVAL); 
    772787    PJ_ASSERT_RETURN(*fromlen >= (int)sizeof(pj_sockaddr_in), PJ_EINVAL); 
     788 
     789    // Return failure if access point is marked as down by app. 
     790    PJ_SYMBIAN_CHECK_CONNECTION(); 
    773791 
    774792    CPjSocket *pjSock = (CPjSocket*)sock; 
     
    869887                     PJ_EINVAL); 
    870888 
     889    // Return failure if access point is marked as down by app. 
     890    PJ_SYMBIAN_CHECK_CONNECTION(); 
     891     
    871892    CPjSocket *pjSock = (CPjSocket*)sock; 
    872893    RSocket &rSock = pjSock->Socket(); 
Note: See TracChangeset for help on using the changeset viewer.