Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

 

hello~

I have some porblem on isocket_connect.

 

My application's socket connection's are fine when it's on PPP Auth NONE.

but when it comes on PAP or CHAP ,  ISOCKET_Connect's callback function is never called, 

even though the PPP connection has been established ( This is checked by QXDM !)

but under the situations,  my Browers 's works very well.

 

so, I am sure that my net connection codes have some kinds of problem.

but i'am not sure what is it.

Should i make the code that  checks the ppp net_state and called ISocket_connect again ?

 

anyone knows about this ? please help me .

 

thank you for reading this.

 

how do u setup PPP for PAP or CHAP. can u post the code?

how do u setup PPP for PAP or CHAP. can u post the code?

if (ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_NET, (void**)(&pMe->m_pINetMgr)) != SUCCESS)
{
 INETMGR_SelectNetwork( pMe->m_pINetMgr, AEE_NETWORK_UMTS(3) );
 
 pMe->m_pISockTCP = INETMGR_OpenSocket(pMe->m_pINetMgr, AEE_SOCK_STREAM);
 
 pMe->m_ServerAddr = xConvertToINAddr(SERVER_ADDR);
 pMe->m_ServerPort = HTONS(SERVER_PORT);
 
 ISOCKET_Connect( pMe->m_pISockTCP, pMe->m_ServerAddr, pMe->m_ServerPort, OnSockConnectCB, pMe );
}
APN information are included in UMTS
It works normal
but When setting auth type PAP or CHAP
OnSockConnectCB function is never called...

if (ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_NET, (void**)(&pMe->m_pINetMgr)) != SUCCESS)
{
 INETMGR_SelectNetwork( pMe->m_pINetMgr, AEE_NETWORK_UMTS(3) );
 
 pMe->m_pISockTCP = INETMGR_OpenSocket(pMe->m_pINetMgr, AEE_SOCK_STREAM);
 
 pMe->m_ServerAddr = xConvertToINAddr(SERVER_ADDR);
 pMe->m_ServerPort = HTONS(SERVER_PORT);
 
 ISOCKET_Connect( pMe->m_pISockTCP, pMe->m_ServerAddr, pMe->m_ServerPort, OnSockConnectCB, pMe );
}
APN information are included in UMTS
It works normal
but When setting auth type PAP or CHAP
OnSockConnectCB function is never called...

Are you sure the device's Browser(the one you say is able to make data call) is working with the same APN (i.e. AEE_NETWORK_UMTS(3))? Is this selected as the Default APN or the Browser asks before making connection for which APN to use?
 
as INetMgr & ISocket are depricated try to use INetwork & ISockPort set of APIs:
INetwork_SelectNetworkEx() for selecting the N/W.
ISockPort For connection:
connectSockPort(Sock *pMe)
{
int nErr, errCode;

pMe->sockAddr.inet.addr = ConvertToINAddr(IP);
pMe->sockAddr.inet.port = HTONS(80);//Port 80 for HTTP Services
pMe->sockAddr.inet.wFamily = AEE_AF_INET;

if(ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_SOCKPORT, (void**)&pMe->pSockPort) != SUCCESS)
return FALSE;

nErr = ISockPort_OpenEx(pMe->pSockPort, AEE_AF_INET, AEE_SOCKPORT_STREAM, AEE_IPPROTO_TCP);
if(nErr != SUCCESS)
return FALSE;

errCode = ISockPort_Connect(pSockPort, (void*)&pMe->sockAddr);

if(errCode == AEE_NET_WOULDBLOCK) {
DBGPRINTF("WAIT...");
CALLBACK_Init(&pMe->writeCB, connectNotify, pMe);
ISOCKPORT_Writeable(pMe->pSockPort, &pMe->writeCB);
break;
}

void connectNotify(Sock *pMe)
{
int errCode;

errCode = ISockPort_Connect(pMe->pSockPort, (void*)&pMe->sockAddr);
switch(errCode)
{
case AEE_NET_WOULDBLOCK:
DBGPRINTF("WAIT...");
CALLBACK_Init(&pMe->writeCB, connectNotify, pMe);
ISOCKPORT_Writeable(pMe->pSockPort, &pMe->writeCB);
break;
case AEE_NET_SUCCESS:
DBGPRINTF("Connect completed successfully and the socket is prepared for reading or writing.");
break;
// SWITCH ALL return codes here.
}

Are you sure the device's Browser(the one you say is able to make data call) is working with the same APN (i.e. AEE_NETWORK_UMTS(3))? Is this selected as the Default APN or the Browser asks before making connection for which APN to use?
 
as INetMgr & ISocket are depricated try to use INetwork & ISockPort set of APIs:
INetwork_SelectNetworkEx() for selecting the N/W.
ISockPort For connection:
connectSockPort(Sock *pMe)
{
int nErr, errCode;

pMe->sockAddr.inet.addr = ConvertToINAddr(IP);
pMe->sockAddr.inet.port = HTONS(80);//Port 80 for HTTP Services
pMe->sockAddr.inet.wFamily = AEE_AF_INET;

if(ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_SOCKPORT, (void**)&pMe->pSockPort) != SUCCESS)
return FALSE;

nErr = ISockPort_OpenEx(pMe->pSockPort, AEE_AF_INET, AEE_SOCKPORT_STREAM, AEE_IPPROTO_TCP);
if(nErr != SUCCESS)
return FALSE;

errCode = ISockPort_Connect(pSockPort, (void*)&pMe->sockAddr);

if(errCode == AEE_NET_WOULDBLOCK) {
DBGPRINTF("WAIT...");
CALLBACK_Init(&pMe->writeCB, connectNotify, pMe);
ISOCKPORT_Writeable(pMe->pSockPort, &pMe->writeCB);
break;
}

void connectNotify(Sock *pMe)
{
int errCode;

errCode = ISockPort_Connect(pMe->pSockPort, (void*)&pMe->sockAddr);
switch(errCode)
{
case AEE_NET_WOULDBLOCK:
DBGPRINTF("WAIT...");
CALLBACK_Init(&pMe->writeCB, connectNotify, pMe);
ISOCKPORT_Writeable(pMe->pSockPort, &pMe->writeCB);
break;
case AEE_NET_SUCCESS:
DBGPRINTF("Connect completed successfully and the socket is prepared for reading or writing.");
break;
// SWITCH ALL return codes here.
}

hum..
thanks for your concern.
As you said, i have tried to use sockport but it made same results.
 
I have tested it(my app is related with mvoip) on several countrys. (china-china unicom, indonesia-3carries, philippine-2carries, korea-2carries)There was no problems.
But this problem only happened in japan-NTT( exactly MVNO bmobile  ) 
Their APN configuration requires PAP or CHAP auth to use PPP.
I have setted it up as it required.
And   it makes no ISocket_Connect callback.
 
My Web Browers( inner brower ) still works well.I still don't know why. 
 
I'm sad.

hum..
thanks for your concern.
As you said, i have tried to use sockport but it made same results.
 
I have tested it(my app is related with mvoip) on several countrys. (china-china unicom, indonesia-3carries, philippine-2carries, korea-2carries)There was no problems.
But this problem only happened in japan-NTT( exactly MVNO bmobile  ) 
Their APN configuration requires PAP or CHAP auth to use PPP.
I have setted it up as it required.
And   it makes no ISocket_Connect callback.
 
My Web Browers( inner brower ) still works well.I still don't know why. 
 
I'm sad.

so even via using ISockPort_Connect() API you do not get even single callback & a response code?
can u try checking a HTTP connection using IWeb? Also is the APN set as a default APN in mobile settings?

so even via using ISockPort_Connect() API you do not get even single callback & a response code?
can u try checking a HTTP connection using IWeb? Also is the APN set as a default APN in mobile settings?

When we call ISockPort_Connect, it never get a single callback.
and  Browser ( inner browser in phone ) is using same APN ( this one is edited by us not a default APN )
As you said , we're going to check HTTP connection using IWeb.
 
Here is korea . so  we'll go to japan this week again  to solve this problem.
After test, i'll post the results here.
 
thanks for your advice.

When we call ISockPort_Connect, it never get a single callback.
and  Browser ( inner browser in phone ) is using same APN ( this one is edited by us not a default APN )
As you said , we're going to check HTTP connection using IWeb.
 
Here is korea . so  we'll go to japan this week again  to solve this problem.
After test, i'll post the results here.
 
thanks for your advice.