Ignore:
Timestamp:
Jun 17, 2009 1:31:13 PM (12 years ago)
Author:
bennylp
Message:

Ticket #758 (Problem with TCP transport on Symbian)

  • fixed TCP recv() to use RecvOneOrMore?()
  • fixed activesock unit test in pjlib-test
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pjlib-test/activesock.c

    r2394 r2771  
    213213        for (i=0; i<10 && last_rx1 == srv1->rx_cnt && last_rx2 == srv2->rx_cnt; ++i) { 
    214214            pj_time_val delay = {0, 10}; 
     215#ifdef PJ_SYMBIAN 
     216            pj_symbianos_poll(-1, 100); 
     217#else 
    215218            pj_ioqueue_poll(ioqueue, &delay); 
     219#endif 
    216220        } 
    217221 
     
    404408        if (status == PJ_EPENDING) { 
    405409            do { 
     410#if PJ_SYMBIAN 
     411                pj_symbianos_poll(-1, -1); 
     412#else 
    406413                pj_ioqueue_poll(ioqueue, NULL); 
     414#endif 
    407415            } while (!state2->sent); 
    408         } else if (status != PJ_SUCCESS) { 
    409                 PJ_LOG(1,("", "   err: send status=%d", status)); 
    410             status = -180; 
    411             break; 
    412         } else if (status == PJ_SUCCESS) { 
    413             if (len != sizeof(*pkt)) { 
    414                 PJ_LOG(1,("", "   err: shouldn't report partial sent")); 
    415                 status = -190; 
    416                 break; 
    417             } 
     416        } else { 
     417#if PJ_SYMBIAN 
     418                /* The Symbian socket always returns PJ_SUCCESS for TCP send, 
     419                 * eventhough the remote end hasn't received the data yet. 
     420                 * If we continue sending, eventually send() will block, 
     421                 * possibly because the send buffer is full. So we need to 
     422                 * poll the ioqueue periodically, to let receiver gets the  
     423                 * data. 
     424                 */ 
     425                pj_symbianos_poll(-1, 0); 
     426#endif 
     427                if (status != PJ_SUCCESS) { 
     428                    PJ_LOG(1,("", "   err: send status=%d", status)); 
     429                    status = -180; 
     430                    break; 
     431                } else if (status == PJ_SUCCESS) { 
     432                    if (len != sizeof(*pkt)) { 
     433                        PJ_LOG(1,("", "   err: shouldn't report partial sent")); 
     434                        status = -190; 
     435                        break; 
     436                    } 
     437                } 
    418438        } 
    419439    } 
     
    421441    /* Wait until everything has been sent/received */ 
    422442    if (state1->next_recv_seq < COUNT) { 
     443#ifdef PJ_SYMBIAN 
     444        while (pj_symbianos_poll(-1, 1000) == PJ_TRUE) 
     445            ; 
     446#else 
    423447        pj_time_val delay = {0, 100}; 
    424448        while (pj_ioqueue_poll(ioqueue, &delay) > 0) 
    425449            ; 
     450#endif 
    426451    } 
    427452 
Note: See TracChangeset for help on using the changeset viewer.