unable to create the instance for socket | developer.brewmp.com unable to create the instance for socket | developer.brewmp.com

Developer

unable to create the instance for socket

Forums:

hi all,
Iam new to BREW and Iam trying to write a socket programming.
I have created a socket using
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_SOCKET,(void **)&pMe->pINetMgr )
but it is returning error as EPRIVLEVEL. I have checked the network option in MIF privilages.
Even then iam getting the same error.

Please help me out in solving this problem.

Thanks in advance,
rajeshwari.

have you loaded the proper mif ? are you testing on simulator or handset?

have you loaded the proper mif ? are you testing on simulator or handset?

rajeshwari wrote:hi all,
Iam new to BREW and Iam trying to write a socket programming.
I have created a socket using
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_SOCKET,(void **)&pMe->pINetMgr )
but it is returning error as EPRIVLEVEL. I have checked the network option in MIF privilages.
Even then iam getting the same error.
Please help me out in solving this problem.
Thanks in advance,
rajeshwari.
when u checked the privillege, did u again relocate the application directory?
in case of mobile did u reset after loading ur new mif with privilige?

rajeshwari wrote:hi all,
Iam new to BREW and Iam trying to write a socket programming.
I have created a socket using
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_SOCKET,(void **)&pMe->pINetMgr )
but it is returning error as EPRIVLEVEL. I have checked the network option in MIF privilages.
Even then iam getting the same error.
Please help me out in solving this problem.
Thanks in advance,
rajeshwari.
when u checked the privillege, did u again relocate the application directory?
in case of mobile did u reset after loading ur new mif with privilige?

Hi thanks for ur replies
Iam testing the application on the simulator.
I have first created some sample project after that i wanted to write the socket code in that so for that i again clicked "execute mif editor" and opened the mif of that particular file and clicked the properties tab and there i selected the network option and saved. then clicked on build->compite mif script.
this is what i did but when i debug the code iam getting the error as "EPRIVLEVEL"

Hi thanks for ur replies
Iam testing the application on the simulator.
I have first created some sample project after that i wanted to write the socket code in that so for that i again clicked "execute mif editor" and opened the mif of that particular file and clicked the properties tab and there i selected the network option and saved. then clicked on build->compite mif script.
this is what i did but when i debug the code iam getting the error as "EPRIVLEVEL"

rajeshwari wrote:Hi thanks for ur replies
Iam testing the application on the simulator.
I have first created some sample project after that i wanted to write the socket code in that so for that i again clicked "execute mif editor" and opened the mif of that particular file and clicked the properties tab and there i selected the network option and saved. then clicked on build->compite mif script.
this is what i did but when i debug the code iam getting the error as "EPRIVLEVEL"
thats all fine, i would like to know after altering mif file did u show the mif path again in ur change applet directory before debuging ur code...
simulator->file->change applet dir..

rajeshwari wrote:Hi thanks for ur replies
Iam testing the application on the simulator.
I have first created some sample project after that i wanted to write the socket code in that so for that i again clicked "execute mif editor" and opened the mif of that particular file and clicked the properties tab and there i selected the network option and saved. then clicked on build->compite mif script.
this is what i did but when i debug the code iam getting the error as "EPRIVLEVEL"
thats all fine, i would like to know after altering mif file did u show the mif path again in ur change applet directory before debuging ur code...
simulator->file->change applet dir..

rajeshwari wrote:
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_SOCKET,(void **)&pMe->pINetMgr )
If you properly check Network option in MIF then you can try the below
Step1: Create Instance of INetMgr
ISHELL_CreateInstance(pMe->a.m_pIShell , AEECLSID_NET, (void **)&pMe->pINetMgr)
Step2: Call INetMgr OPen socket to create a socket.
TCP socket
pMe->pISocket=INETMGR_OpenSocket(pMe->pINetMgr,AEE_SOCK_STREAM);
"or"
UDP Socket
pMe->pISocket=INETMGR_OpenSocket(pMe->pINetMgr,AEE_SOCK_DGRAM);

rajeshwari wrote:
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_SOCKET,(void **)&pMe->pINetMgr )
If you properly check Network option in MIF then you can try the below
Step1: Create Instance of INetMgr
ISHELL_CreateInstance(pMe->a.m_pIShell , AEECLSID_NET, (void **)&pMe->pINetMgr)
Step2: Call INetMgr OPen socket to create a socket.
TCP socket
pMe->pISocket=INETMGR_OpenSocket(pMe->pINetMgr,AEE_SOCK_STREAM);
"or"
UDP Socket
pMe->pISocket=INETMGR_OpenSocket(pMe->pINetMgr,AEE_SOCK_DGRAM);

hi brewin,
thanks for the reply i have given all the privilages but still im getting the error i have changed the applet directory in the simulator also to the path where i have stored my mif file. still there is no use.
Is there anything i need to get it from qualcomm or something else is required for the socket programming??
Thanks for all ur replies.

hi brewin,
thanks for the reply i have given all the privilages but still im getting the error i have changed the applet directory in the simulator also to the path where i have stored my mif file. still there is no use.
Is there anything i need to get it from qualcomm or something else is required for the socket programming??
Thanks for all ur replies.

did You check with ISockPort Interface. But ISocket Interface should work, I have used ISocket Interface for 2.x and 3.x devices. Can you post the code as it as you using..

did You check with ISockPort Interface. But ISocket Interface should work, I have used ISocket Interface for 2.x and 3.x devices. Can you post the code as it as you using..

Hi,
This is my code i have written it for testing purpose im new to BREW and I also I have never worked on BREW.
I didnt write any client server application i just wrote a program to create a socket.
case EVT_APP_START:
// Add your code here...
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_SOCKETSERVER,(void **)&pMe->pINetMgr
pMe->pISocket = INETMGR_OpenSocket(pMe->pINetMgr, AEE_SOCK_STREAM);
if (pMe->pISocket == NULL)
{
int nErr = ISOCKET_GetLastError(pMe->pISocket);
ISHELL_CloseApplet(pMe->a.m_pIShell, FALSE);
}
return(TRUE);
the above code is always breaking when i run it in the simulator at the point where it INETMGR_OpenSocket(). so for that i wrote an if condition at ISHELL_CreateInstance to check whether it is returning EPRIVLEVEL or not there it is returning EPRIVLEVEL. so thought because of that error it is breaking the opensocket function. is my assumption correct??

Hi,
This is my code i have written it for testing purpose im new to BREW and I also I have never worked on BREW.
I didnt write any client server application i just wrote a program to create a socket.
case EVT_APP_START:
// Add your code here...
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_SOCKETSERVER,(void **)&pMe->pINetMgr
pMe->pISocket = INETMGR_OpenSocket(pMe->pINetMgr, AEE_SOCK_STREAM);
if (pMe->pISocket == NULL)
{
int nErr = ISOCKET_GetLastError(pMe->pISocket);
ISHELL_CloseApplet(pMe->a.m_pIShell, FALSE);
}
return(TRUE);
the above code is always breaking when i run it in the simulator at the point where it INETMGR_OpenSocket(). so for that i wrote an if condition at ISHELL_CreateInstance to check whether it is returning EPRIVLEVEL or not there it is returning EPRIVLEVEL. so thought because of that error it is breaking the opensocket function. is my assumption correct??

Hi,
I think u have to use AEECLSID_NET classid when creating INetMgr interface.
try with this
if (ISHELL_CreateInstance(pMe->pIShell, AEECLSID_NET,
(void **)&pMe->pINetMgr) != SUCCESS) {
pMe->pINetMgr = NULL;
return FALSE;
}
//Create socket in Stream mode(TCP)
pMe->pISocket = INETMGR_OpenSocket(pMe->pINetMgr, AEE_SOCK_STREAM);
if (!pMe->pISocket)
{
..........
}
Thanks,
Sridhar A.

Hi,
I think u have to use AEECLSID_NET classid when creating INetMgr interface.
try with this
if (ISHELL_CreateInstance(pMe->pIShell, AEECLSID_NET,
(void **)&pMe->pINetMgr) != SUCCESS) {
pMe->pINetMgr = NULL;
return FALSE;
}
//Create socket in Stream mode(TCP)
pMe->pISocket = INETMGR_OpenSocket(pMe->pINetMgr, AEE_SOCK_STREAM);
if (!pMe->pISocket)
{
..........
}
Thanks,
Sridhar A.

hi sridhar,
thanks for the reply now it is working fine not returning the privilage error.
can u share some sample code for client - server application in BREW iam new to Socket programming and also BREW.
thanks in advance,
rajeshwari.

hi sridhar,
thanks for the reply now it is working fine not returning the privilage error.
can u share some sample code for client - server application in BREW iam new to Socket programming and also BREW.
thanks in advance,
rajeshwari.

rajeshwari wrote:hi brewin,
thanks for the reply i have given all the privilages but still im getting the error i have changed the applet directory in the simulator also to the path where i have stored my mif file. still there is no use.
Thanks for all ur replies.
In my post I clearly given that, AEECLSID_NET is used for creating INetMgr Instance. Even after posting the code your are not able to find any difference between AEECLSID_NET and AEECLSID_SOCKETSERVER. Someone has find it out for you. :rolleyes:

rajeshwari wrote:hi brewin,
thanks for the reply i have given all the privilages but still im getting the error i have changed the applet directory in the simulator also to the path where i have stored my mif file. still there is no use.
Thanks for all ur replies.
In my post I clearly given that, AEECLSID_NET is used for creating INetMgr Instance. Even after posting the code your are not able to find any difference between AEECLSID_NET and AEECLSID_SOCKETSERVER. Someone has find it out for you. :rolleyes:

i saw AEECLSID_NET in your post but i thought that was the name of the applet u gave im totally new to brew and there is no guidence in my off also im just developing some applications by searching on the net and in ur post u no where mentioned abt the importance of the AEECLSID_NET i mean u didnt talk abt that u just gave the code so i thought that was the name of the applet so i replaced it with the name of my applet

i saw AEECLSID_NET in your post but i thought that was the name of the applet u gave im totally new to brew and there is no guidence in my off also im just developing some applications by searching on the net and in ur post u no where mentioned abt the importance of the AEECLSID_NET i mean u didnt talk abt that u just gave the code so i thought that was the name of the applet so i replaced it with the name of my applet

rajeshwari wrote:i saw AEECLSID_NET in your post but i thought that was the name of the applet u gave im totally new to brew and there is no guidence in my off also im just developing some applications by searching on the net and in ur post u no where mentioned abt the importance of the AEECLSID_NET i mean u didnt talk abt that u just gave the code so i thought that was the name of the applet so i replaced it with the name of my applet
rajeshwari!!
int ISHELL_CreateInstance(IShell * pIShell, AEECLSID cls, void * * ppobj)
Parameters:
pIShell : [in] : Pointer to the IShell Interface object.
cls : [in] : 32-bit ClassID of the requested interface.
ppobj : [out] : Pointer to the memory to fill with the pointer to the object.
api reference clearly says its an classid of requested interface not of ur applet, brewin was meant to say he had given u the code sniplet for the connection, we do know that its a tough job for fresher, but lot many posts are there on this forum which can help you....
Happy coding on brew :)

rajeshwari wrote:i saw AEECLSID_NET in your post but i thought that was the name of the applet u gave im totally new to brew and there is no guidence in my off also im just developing some applications by searching on the net and in ur post u no where mentioned abt the importance of the AEECLSID_NET i mean u didnt talk abt that u just gave the code so i thought that was the name of the applet so i replaced it with the name of my applet
rajeshwari!!
int ISHELL_CreateInstance(IShell * pIShell, AEECLSID cls, void * * ppobj)
Parameters:
pIShell : [in] : Pointer to the IShell Interface object.
cls : [in] : 32-bit ClassID of the requested interface.
ppobj : [out] : Pointer to the memory to fill with the pointer to the object.
api reference clearly says its an classid of requested interface not of ur applet, brewin was meant to say he had given u the code sniplet for the connection, we do know that its a tough job for fresher, but lot many posts are there on this forum which can help you....
Happy coding on brew :)