hi,everyone, i am a freshman in symbian programmer, i need to do a programme using rtp api to send data, but i had a problem about setup a rtp connection, when my programme pop up a dialog to choose a net,then it cannot connect even if the ip address is right, the following is my code about connection, can any people tell me where wrong,thanks a lot

void CRtpTest::EstablishConnectionL(TDesC* aAddr, TUint aLocalPort, TUint aRemotePort) //using for setup a socket connection
{
localPort = aLocalPort;
remotePort = aRemotePort;
RemoteAddr.Input(*aAddr);
RemoteAddr.SetPort(remotePort);
localAddr.SetPort(localPort);
User::LeaveIfError(iSocketServer.Connect(KESockDefaultMessageSlots));
User::LeaveIfError(iConnection.Open(iSocketServer, KConnectionTypeDefault));
iConnState = ETrue;
}

void CRtpTest::StartRTPConnectionL(TDesC* aAddr, TUint aLocalPort, TUint aRemotePort)
{

iErrorNotify=0;
TInt err1;

EstablishConnectionL(aAddr, aLocalPort, aRemotePort);

iRtpSession = CRtpAPI::NewL(*this);


iParam.iCName.Set(KName);
iParam.iUserName.Set(KName);
iParam.iEmail.Set(KName);
iParam.iPhoneNumber.Set(KName);
iParam.iLocation.Set(KName);
iParam.iSwToolName.Set(KName);
iParam.iNoticeStatus.Set(KName);
iParam.iPrivate.Set(KName);




// Open RTP session
err1 = iRtpSession->OpenL( iParam, NULL, &iSocketServer,&iConnection);
if (err1 != KErrNone)
{
CEikonEnv::Static()->InfoWinL(_L("Error"), _L("Cannot open a Rtp Connection!"));
return;
}

err1 = iRtpSession->StartConnection();
if (err1 != KErrNone)
{
CEikonEnv::Static()->InfoWinL(_L("Error"), _L("Cannot Start a Rtp Connection!"));
return;
}

iTimeStamp = 10;

// Create new RTP session
TCreateSessionParams sessionParam = TCreateSessionParams();
sessionParam.iPriority = TCreateSessionParams::EPriorityStandard;
sessionParam.iSocketBufSize = 10000; // For RTP sending only;


iRtpId = iRtpSession->CreateSessionL( sessionParam,
localPort,
EFalse,
NULL );

if (iRtpId == KNullId)
{
CEikonEnv::Static()->InfoWinL(_L("Error"), _L("Cannot creat a Rtp Session!"));
return;
}

err1 = iRtpSession->SetRemoteAddress(iRtpId, RemoteAddr );
if (err1 != KErrNone)
{
CEikonEnv::Static()->InfoWinL(_L("Error"), _L("Cannot set remote address!"));
return;
}



User::LeaveIfError(iSock.Open(iSocketServer, KAfInet, KSockDatagram, KProtocolInetUdp, iConnection));
iSock.Connect(RemoteAddr, iSocketStatus);




// Start RTP send stream
TTranStreamParams aTransmitParams;
aTransmitParams.iPayloadType = NULL;

iTransmitStreamId = iRtpSession->CreateTransmitStreamL(iRtpId, aTransmitParams, iSsrcId);
if (iTransmitStreamId == KNullId)
{
CEikonEnv::Static()->InfoWinL(_L("Error"), _L("Cannot Creat a Rtp TransmitStream!"));
return;
}

iSendHeader = TRtpSendHeader();

// Start RTP session
err1 = iRtpSession->StartSession(iRtpId);
if (err1 != KErrNone)
{
CEikonEnv::Static()->InfoWinL(_L("Error"), _L("Cannot start a rtp session!"));
return;
}
// CEikonEnv::Static()->InfoWinL(_L("Info"), _L("Start a rtp session Successful!"));
}