Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help Creating Sequence Number

 
Todd Plambeck
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a wireless app that uses UDP for communication with the server. I need to create a unique sequence number for each message for my acknowlegement mechanism. I was planning on using getTimeInMillis, but apparently that is not available in J2ME. Does anyone have a good alternative to this? I'd like to use a long for the value. The sequence number needs to be unique only for one phone. The server uses getTimeInMillis quite nicely. Any help greatly appreciated.

Thanks,

Todd
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about a regular instance variable for a counter, and append it to the person's phone number.

Mark
 
Todd Plambeck
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would I be able to ensure uniqueness across sessions?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic