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

Developer

Forums

Forums:

Hi,

I have an application which connects to a server and sets the state on the server.

I wanted to use ISocket instead of IWEB to connect quicker to my server socket. (I have always used IWEB earlier). I created the INetMgr and the ISocket objects without any problem. But when I call ISOCKET_Connect() and specify the callback function, the call back never gets called.

According to the BREW 1.1 API reference document..

"After establishment of a connection to the Internet (and in the case of AEE_SOCK_STREAM
sockets, the TCP connection) or in the event of a failure, the specified callback is called."

But the callback is never called.

And the ISOCKET_Connect always returns AEE_NET_SUCCESS even if I give the wrong IP address. Can you tell me what is going wrong?

Here are some snippets of code..
**
#define VE_GATEWAY "x.x.x.x"
#define VE_PORT 5555
**

**
usigned long * pulAddr;
pulAddr = (unsigned long *) MALLOC(sizeof(long)*4);

if(INET_ATON(VE_GATEWAY, pulAddr)){ // Network byte order for server address

pMe->veAddr = *pulAddr;
}

pMe->vePort = HTONS(VE_PORT);
**

**

if ((iRetValue = (ISOCKET_Connect(pMe->m_pSocket, pMe->veAddr, pMe->vePort, (PFNCONNECTCB)VeClient_ConnectB, (void *)po))) != AEE_NET_SUCCESS)
{
if (iRetValue != AEE_NET_WOULDBLOCK)
{

// Get Last error
lastError = ISOCKET_GetLastError(pMe->m_pSocket);
DBGPRINTF("Network Error %d",lastError);
// Release NetMgr & ISocket and return.
ReleaseNetAndSocket (pMe);
return 0;
}

}

**

Thanks

There is a known issue with BREW 1.x SDK's. More info at
http://www.qualcomm.com/brew/developer/resources/ds/faq/techfaq29.html#T1T
:cool:

There is a known issue with BREW 1.x SDK's. More info at
http://www.qualcomm.com/brew/developer/resources/ds/faq/techfaq29.html#T1T
:cool:

Hi,
Thanks for the info about the bug in the SDK. But there is another question I have.
Why is the return value of ISOCKET_Connect always AEE_NET_SUCCESS even though there was no contact with the server? Does this return value just mean that the socket was able to communicate with the lower layers of BREW to initiate a TCP connection?
I was able to test the presence of my server by using a simple java client. But I was not able to contact the server using the BREW simulator. But the ISOCKET_COnnect always returns AEE_NET_SUCCESS.
Any clues as to what might be happening here?
Thanks

Hi,
Thanks for the info about the bug in the SDK. But there is another question I have.
Why is the return value of ISOCKET_Connect always AEE_NET_SUCCESS even though there was no contact with the server? Does this return value just mean that the socket was able to communicate with the lower layers of BREW to initiate a TCP connection?
I was able to test the presence of my server by using a simple java client. But I was not able to contact the server using the BREW simulator. But the ISOCKET_COnnect always returns AEE_NET_SUCCESS.
Any clues as to what might be happening here?
Thanks

ISOCKET_Connect() only returns non-SUCCESS if the callback function pointer is invalid. Any errors related to the connection establishment are reported in the callback.

ISOCKET_Connect() only returns non-SUCCESS if the callback function pointer is invalid. Any errors related to the connection establishment are reported in the callback.

Hi. I've faced the same problem on VX4700. Callback function to ISocket_Connect is never called. Is this a known issue?
Sly

Hi. I've faced the same problem on VX4700. Callback function to ISocket_Connect is never called. Is this a known issue?
Sly