datacommsserver/esockserver/test/TE_EsockTestSteps/src/EsockTestBase.cpp
branchRCL_3
changeset 21 07656293a99c
parent 18 9644881fedd0
equal deleted inserted replaced
19:35c06c1d4fa6 21:07656293a99c
  1122 		delete c;
  1122 		delete c;
  1123 
  1123 
  1124 	return error;
  1124 	return error;
  1125 	}
  1125 	}
  1126 
  1126 
       
  1127 TInt CCEsockTestBase::RemoveConnection(const TDesC& aConnectionName)
       
  1128     {
       
  1129     //check if this connection hasn't been created already
       
  1130     if (iConns.Find(aConnectionName)==NULL)
       
  1131         return KErrNotFound;
       
  1132 
       
  1133     iConns.Remove(aConnectionName);
       
  1134     return KErrNone;
       
  1135     }
       
  1136 
       
  1137 
       
  1138 
  1127 TInt CCEsockTestBase::OpenConnection(const TRConnectionParams& aParams)
  1139 TInt CCEsockTestBase::OpenConnection(const TRConnectionParams& aParams)
  1128 	{
  1140 	{
  1129     RSocketServ* ss = iSockServs.Find(aParams.iSockServName);
  1141     RSocketServ* ss = iSockServs.Find(aParams.iSockServName);
  1130     if (ss==NULL)
  1142     if (ss==NULL)
  1131 		return KErrNotFound;
  1143 		return KErrNotFound;
  1253 	if (c==NULL)
  1265 	if (c==NULL)
  1254 		return KErrNotFound;
  1266 		return KErrNotFound;
  1255 	TRequestStatus* requestStatus = NULL;
  1267 	TRequestStatus* requestStatus = NULL;
  1256 	if (aParams.iAsynch)
  1268 	if (aParams.iAsynch)
  1257 		{
  1269 		{
  1258 		requestStatus = new TRequestStatus;
  1270 				//The request status may well already be there (created by the previous iteration?)
  1259 	    if (requestStatus==NULL)
  1271         requestStatus = iRequestStatuses.Find(aParams.iConnectionName);
  1260 	    	return KErrNoMemory;
  1272         if (requestStatus == NULL)
  1261 	    
  1273             {
  1262 		TInt error = iRequestStatuses.Add(requestStatus, aParams.iConnectionName);
  1274             requestStatus = new TRequestStatus;
  1263 		if (error!=KErrNone)
  1275             if (requestStatus==NULL)
  1264 			{
  1276                 return KErrNoMemory;
  1265 			delete requestStatus;
  1277             
  1266 			return error;
  1278             TInt error = iRequestStatuses.Add(requestStatus, aParams.iConnectionName);
  1267 			}
  1279             if (error!=KErrNone)
       
  1280                 {
       
  1281                 delete requestStatus;
       
  1282                 return error;
       
  1283                 }
       
  1284             }
  1268 		}
  1285 		}
  1269 
  1286 
  1270 	TInt error;
  1287 	TInt error;
  1271 	if (aParams.iStartWithSnapPreferences)
  1288 	if (aParams.iStartWithSnapPreferences)
  1272 		{
  1289 		{