Ignore:
Timestamp:
Jun 25, 2009 12:26:15 PM (15 years ago)
Author:
bennylp
Message:

Ticket #759: Problem with TCP transport on Symbian

  • backported changes in #758
File:
1 edited

Legend:

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

    r2482 r2804  
    126126void CPjSocketReader::ConstructL(unsigned max_len) 
    127127{ 
    128     TProtocolDesc aProtocol; 
    129     TInt err; 
    130  
    131     err = sock_.Socket().Info(aProtocol); 
    132     User::LeaveIfError(err); 
    133  
    134     isDatagram_ = (aProtocol.iSockType == KSockDatagram); 
     128    isDatagram_ = sock_.IsDatagram(); 
    135129 
    136130    TUint8 *ptr = new TUint8[max_len]; 
     
    518512 
    519513    /* Wrap Symbian RSocket into PJLIB's CPjSocket, and return to caller */ 
    520     CPjSocket *pjSock = new CPjSocket(af, rSock); 
     514    CPjSocket *pjSock = new CPjSocket(af, type, rSock); 
    521515    *p_sock = (pj_sock_t)pjSock; 
    522516 
     
    734728 
    735729    CPjSocket *pjSock = (CPjSocket*)sock; 
    736     RSocket &rSock = pjSock->Socket(); 
    737730 
    738731    if (pjSock->Reader()) { 
     
    758751    TPtr8 data((TUint8*)buf, (TInt)*len, (TInt)*len); 
    759752 
    760     rSock.Recv(data, flags, reqStatus, recvLen); 
     753    if (pjSock->IsDatagram()) { 
     754        pjSock->Socket().Recv(data, flags, reqStatus); 
     755    } else { 
     756        // Using static like this is not pretty, but we don't need to use 
     757        // the value anyway, hence doing it like this is probably most 
     758        // optimal. 
     759        static TSockXfrLength len; 
     760        pjSock->Socket().RecvOneOrMore(data, flags, reqStatus, len); 
     761    } 
    761762    User::WaitForRequest(reqStatus); 
    762763 
     
    998999 
    9991000    // Create PJ socket 
    1000     CPjSocket *newPjSock = new CPjSocket(pjSock->GetAf(), newSock); 
     1001    CPjSocket *newPjSock = new CPjSocket(pjSock->GetAf(), pjSock->GetSockType(), 
     1002                                         newSock); 
    10011003    newPjSock->SetConnected(true); 
    10021004 
Note: See TracChangeset for help on using the changeset viewer.