Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help Creating Sequence Number  RSS feed

 
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
 
ranger
Sheriff
Posts: 17314
11
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?
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!