datacommsserver/esockserver/test/TE_EsockTestSteps/src/EsockTestBase.cpp
changeset 40 34fc115b8742
parent 25 e53adc4c49de
child 65 41cc8e7ff496
equal deleted inserted replaced
34:6646e488a904 40:34fc115b8742
   833     if (aParams.iConnectionName.Length()>0)
   833     if (aParams.iConnectionName.Length()>0)
   834     	{
   834     	{
   835 		RConnection* c = iConns.Find(aParams.iConnectionName);
   835 		RConnection* c = iConns.Find(aParams.iConnectionName);
   836 		if (c==NULL)
   836 		if (c==NULL)
   837 			return KErrNotFound;
   837 			return KErrNotFound;
   838 		error = s->Open(*ss, KAfInet, aParams.iSocketType, aParams.iProtocol, *c);
   838 		error = s->Open(*ss, aParams.iAddrFamily, aParams.iSocketType, aParams.iProtocol, *c);
   839 		}
   839 		}
   840 	else if (aParams.iSubconnectionName.Length()>0)
   840 	else if (aParams.iSubconnectionName.Length()>0)
   841     	{
   841     	{
   842 		RSubConnection* sc = iSubConns.Find(aParams.iSubconnectionName);
   842 		RSubConnection* sc = iSubConns.Find(aParams.iSubconnectionName);
   843 		if (sc==NULL)
   843 		if (sc==NULL)
   844 			{
   844 			{
   845 			return KErrNotFound;
   845 			return KErrNotFound;
   846 			}
   846 			}
   847 		error = s->Open(*ss, KAfInet, aParams.iSocketType, aParams.iProtocol, *sc);
   847 		error = s->Open(*ss, aParams.iAddrFamily, aParams.iSocketType, aParams.iProtocol, *sc);
   848 		}
   848 		}
   849 	else if (aParams.iProtocolName.Length()>0)
   849 	else if (aParams.iProtocolName.Length()>0)
   850 		{
   850 		{
   851 		error = s->Open(*ss,aParams.iProtocolName);
   851 		error = s->Open(*ss,aParams.iProtocolName);
   852 		}
   852 		}
   853 	else
   853 	else
   854 		{
   854 		{
   855 		error = s->Open(*ss, KAfInet, aParams.iSocketType, aParams.iProtocol);
   855 		error = s->Open(*ss, aParams.iAddrFamily, aParams.iSocketType, aParams.iProtocol);
   856 		}
   856 		}
   857 
   857 
   858 
   858 
   859 	return error;
   859 	return error;
   860 	}
   860 	}
   861 
   861 
   862 TInt CCEsockTestBase::BindSocket(const TRSocketParams& /*aParams*/)
   862 TInt CCEsockTestBase::BindSocket(TRSocketParams& aSockeSParams)
   863 	{
   863 	{
   864     return KErrNotSupported;
       
   865     /*
       
   866     RSocket* s = iSocks.Find(aSockeSParams.iSocketName);
   864     RSocket* s = iSocks.Find(aSockeSParams.iSocketName);
   867 	if (s==NULL)
   865 	if (s==NULL)
   868 		return KErrNotFound;
   866 		return KErrNotFound;
   869 
   867 
   870 	TInt error = KErrNone;
   868 	TInt error = KErrNone;
   872 	    error = s->SetOpt(KSoUdpSynchronousSend,KSolInetUdp,1);
   870 	    error = s->SetOpt(KSoUdpSynchronousSend,KSolInetUdp,1);
   873 	if (error!=KErrNone)
   871 	if (error!=KErrNone)
   874 		return error;
   872 		return error;
   875 
   873 
   876 	//bind to Local address for TCP or UDP
   874 	//bind to Local address for TCP or UDP
       
   875 	
   877 	return s->Bind(aSockeSParams.iLocalIP);
   876 	return s->Bind(aSockeSParams.iLocalIP);
   878 	*/
       
   879 	}
   877 	}
   880 
   878 
   881 TInt CCEsockTestBase::ConnectSocket(TRSocketParams& aParams, TRequestStatus& aRequestStatus)
   879 TInt CCEsockTestBase::ConnectSocket(TRSocketParams& aParams, TRequestStatus& aRequestStatus)
   882 	{
   880 	{
   883     RSocket* s = iSocks.Find(aParams.iSocketName);
   881     RSocket* s = iSocks.Find(aParams.iSocketName);
  1481 	else
  1479 	else
  1482 	    {
  1480 	    {
  1483 	    User::WaitForRequest(ec->iEventReceived);
  1481 	    User::WaitForRequest(ec->iEventReceived);
  1484 	    }
  1482 	    }
  1485 	aNifProgress = (ec->iEventReceived.Int()==KErrNone)? &ec->iProgressBuf() : NULL;
  1483 	aNifProgress = (ec->iEventReceived.Int()==KErrNone)? &ec->iProgressBuf() : NULL;
  1486 	return ec->iEventReceived.Int();
  1484 	return ec->iEventReceived.Int() == KRequestPending ? KErrNone : ec->iEventReceived.Int();
  1487 	}
  1485 	}
  1488 
  1486 
  1489 
  1487 
  1490 //mobility extensions
  1488 //mobility extensions
  1491 RCommsMobilityApiExt* CCEsockTestBase::FindMobilityExtension(const TDesC& aMobilityExtensionName)
  1489 RCommsMobilityApiExt* CCEsockTestBase::FindMobilityExtension(const TDesC& aMobilityExtensionName)