Ticket #758 (Problem with TCP transport on Symbian)
- fixed TCP recv() to use RecvOneOrMore()
- fixed activesock unit test in pjlib-test
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2771 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjlib/src/pj/sock_symbian.cpp b/pjlib/src/pj/sock_symbian.cpp
index a0ca80e..6062172 100644
--- a/pjlib/src/pj/sock_symbian.cpp
+++ b/pjlib/src/pj/sock_symbian.cpp
@@ -125,13 +125,7 @@
void CPjSocketReader::ConstructL(unsigned max_len)
{
- TProtocolDesc aProtocol;
- TInt err;
-
- err = sock_.Socket().Info(aProtocol);
- User::LeaveIfError(err);
-
- isDatagram_ = (aProtocol.iSockType == KSockDatagram);
+ isDatagram_ = sock_.IsDatagram();
TUint8 *ptr = new TUint8[max_len];
buffer_.Set(ptr, 0, (TInt)max_len);
@@ -517,7 +511,7 @@
/* Wrap Symbian RSocket into PJLIB's CPjSocket, and return to caller */
- CPjSocket *pjSock = new CPjSocket(af, rSock);
+ CPjSocket *pjSock = new CPjSocket(af, type, rSock);
*p_sock = (pj_sock_t)pjSock;
return PJ_SUCCESS;
@@ -733,7 +727,6 @@
PJ_SYMBIAN_CHECK_CONNECTION();
CPjSocket *pjSock = (CPjSocket*)sock;
- RSocket &rSock = pjSock->Socket();
if (pjSock->Reader()) {
CPjSocketReader *reader = pjSock->Reader();
@@ -757,7 +750,15 @@
TSockXfrLength recvLen;
TPtr8 data((TUint8*)buf, (TInt)*len, (TInt)*len);
- rSock.Recv(data, flags, reqStatus, recvLen);
+ if (pjSock->IsDatagram()) {
+ pjSock->Socket().Recv(data, flags, reqStatus);
+ } else {
+ // Using static like this is not pretty, but we don't need to use
+ // the value anyway, hence doing it like this is probably most
+ // optimal.
+ static TSockXfrLength len;
+ pjSock->Socket().RecvOneOrMore(data, flags, reqStatus, len);
+ }
User::WaitForRequest(reqStatus);
if (reqStatus == KErrNone) {
@@ -997,7 +998,8 @@
}
// Create PJ socket
- CPjSocket *newPjSock = new CPjSocket(pjSock->GetAf(), newSock);
+ CPjSocket *newPjSock = new CPjSocket(pjSock->GetAf(), pjSock->GetSockType(),
+ newSock);
newPjSock->SetConnected(true);
*newsock = (pj_sock_t) newPjSock;