A number of our users have noticed that there is a conflict when more
than one SMS-monitoring application is running at the same time.
After discussing it with our partners at RIM, it looks like the
problem is tied to port 0. Whichever application happens to access
port 0 first (when the phone boots) will block all other applications
from listening on it.
After discussing the problem with several of you, as well as our
contact at RIM, we've come up with the following plan to compensate:
* Application "A" launches first when the device boots. It tries to
bind to port 0. Port 0 is available, so "A" successfully binds to it.
* Whenever a message is received on port 0, "A" immediately raises a
global event. That event includes all the information in the original
message (contents, envelope, etc.)
* Application "B" launches later. It tries to bind to port 0. Port 0
is not available, so "B" begins listening for global events.
* When "A" raises a global event, "B" parses the contents and uses
them for normal program function.
* When "A" quits, it raises a global event notifying all listening
applications that port 0 is available.
* All listening applications try to bind to port 0. Only one of them
succeeds. It immediately begins raising global events that include all
the information from the message stream on port 0.
* Etc...
This is currently our second draft, and has one or two open questions
that need to be resolved. In particular, we haven't determined what
happens if the application bound to port 0 unexpectedly terminates.
One option is a "check-in" system, whereby:
* Application "A" (which originally bound to port 0) raises a global
event every second notifying listening applications that it is still
active.
* If listening applications do not catch that global event, then they
attempt to bind to port 0. When one succeeds, it begins sending out a
global event every second, etc...
If anyone has thoughts on the above system, please post a reply to the
group. Also, feel free to invite any other developers or companies
whom you suspect this issue affects.
Best,
~ Cristos
Chief Information Officer
Dexrex, LLC
c...@dexrex.com
http://www.dexrex.com