Symbian OS error

Forum for J2ME mobile games related topics including programming doubts, books and other resources for J2ME game development

Symbian OS error

Postby hemavarthini » Tue Mar 27, 2007 8:57 am

Hi
I am developing an game .I am using http connection.I am getting symbian os error=-34 and also symbian os error=-36.
I am getting these errors only in nokia 6600 and nokia 6680.
It works properly in 6230i.
Please give me the solution to solve the problem
Thanks
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Postby DevelopmentTeam » Tue Mar 27, 2007 11:00 am

when it comes to httpconnection with 6600, it will mainly be a problem with multiple thread trying to connect through http. please check if you are maintaining the threading correctly, if there are 2 threads trying to connect to a url some phones which you listed throw error. So tune your code insuch a way that there are only one http object at any time.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby hemavarthini » Tue Mar 27, 2007 11:28 am

Hi
I am using 3 canvas and in each canvas i am using class for server connection.I have 3 games in a package.
For example in the game1canvas i have a thread and i am using server connection in the game1class.In the game1server i am opening the http connection 5 times and closing the connection after i have used it.
So the same things in all the three canvas.
So now tell me in what place i am making mistake
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Postby DevelopmentTeam » Tue Mar 27, 2007 12:13 pm

The simple thing is how you use the http thread. I know you will be creating an instance of httpconnection class and use it in the thread. Now you'll be starting the thread continuously 3 times. now what happens is either the threads try to start at the same time and create more than one http object simultaniously.

To avoid this use a boolean in the httpconnection class to keep track of number of threads and make the other threads to wait untill the first one finishes the task. or use a seperate function where you creat the httpconnection object and declare it as 'syncronized' keyword.

Another point is remember to close the http object and put = null everytime before you use it next time.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby hemavarthini » Thu Mar 29, 2007 8:47 am

Hi,Thanks for ur information.
But i have checked the active count during http connection.
I got the result as 1.
Even thuough i got the result as 1,i am getting symbian os error still.
Please Give me the solution
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Postby DevelopmentTeam » Thu Mar 29, 2007 10:42 am

Can you please paste the codeing here which deals with the http connection.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby hemavarthini » Thu Mar 29, 2007 12:16 pm

Hi this is a part of http connection coding.So like this i have used 5 to 6 http connections.

public String[] mConnection(String x,String y){
HttpConnection cc;
DataInputStream inn;
byte b1[]=new byte[1064];
try{
cc=(HttpConnection)Connector.open("http://111.151.60.20/sample/sample.jsp?plid="+id);
inn=cc.openDataInputStream();
inn.read(b1);
strvalue=new String(b1).trim();
inn.close();
intLength=strvalue.indexOf("*");
strvalue1=strvalue.substring(0, intLength);

cc.close();
return strvalue1;
}
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Postby DevelopmentTeam » Thu Mar 29, 2007 12:57 pm

Now the code it good, there is no bug with the coding you have sent. I think it would be better to add

Code: Select all
cc = null;


and make this function Syncronized

Otherwise the problem would be with the server...
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby hemavarthini » Thu Mar 29, 2007 1:29 pm

If there 4 connection method like this,then should i add synchronized keyword for the all 4 methods??
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Postby DevelopmentTeam » Thu Mar 29, 2007 3:07 pm

yes, you have to some how make sure that there are no 2 connections trying to connect at the same time.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby hemavarthini » Fri Mar 30, 2007 10:59 am

Thanks for the information u have given so far.We will meet soon in some other topic.
Thanx
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Postby DevelopmentTeam » Fri Mar 30, 2007 12:28 pm

No problem, but is the bug fixed yet? or please let me know if you can send the code..
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby hemavarthini » Mon Apr 02, 2007 4:47 am

No,the problem is not solved yet.I am getting symbian os error still.
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Postby DevelopmentTeam » Mon Apr 02, 2007 4:51 am

1) If you get the error right at the first time itself, then the problem might be with the service provider.
2) If you get it in between, like accessing same url continously then it is with your code.

Now if you think it is your code, just email me your code if you wish. to enquiry@smackall.com I will try my best on it. :)
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby hemavarthini » Mon Apr 02, 2007 4:58 am

I am getting the error only inbetween the game.So as u said it is the case2.
But the same code when i run it in 6230i ,i am not getting any problem.
So I think my code is correct.
The problem may because of symbian os in nokia 6600.
What is your opinion to this?
I am not in a position to send the code.Sorry for saying this.
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Next

Return to J2ME Games

Who is online

Users browsing this forum: No registered users and 1 guest

cron