This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Terminating Network Communication

 
Danish Shaukat
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am using a separate thread for exchanging data between my midlet and servlet. Is there any way to terminate or cancel this operation?

Since there is no way to forcibly stop a thread in CLDC 1.0, so how will a user cancel the network communication? This might be required if it is taking too long or for any other reason.

Danish
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well if it was my phone, I'd just hit the "Cancel" button. Basically I can end anything hitting this key. It is the "Hang up call" button.

Mark
 
Danish Shaukat
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark,

Thanks for replying. Some phones do have this Cancel button. But this is the phone�s Cancel button. It is not a command mapped on to the soft key by the midlet. Hitting this will destroy the midlet and the user will exit.

So, is there a way of programmatically terminating network communication/threads in J2ME?

Danish
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can always add a Command to the "Screen" using the Command object, and selecting it would kill the application.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic