Question

I am trying to get my cell app to work using the push registry technology.

According to the specs you should be-able to use SOCKETS, DATAGRAMS or SMS.

But I always get an IOException when calling registerConnection() when dynamical registring an Inbound Connection. When trying to register SOCKETS or DATAGRAMS

I not even sure it is possible, cause the web only has working SMS examples.

Any indications would be most appreciated!

Was it helpful?

Solution

I managed to solve the IOException problem.

The authoritative article http://developers.sun.com/mobility/midp/articles/pushreg/ fails to mention that calls to registerConnection() will most likely fail (as detailed in the question).

but repeat attempts will discover the real port assigned to the device as shown below:

public void run(){
             int failCount = 0;
             String base = "55";
             String temp = "";
             while (failCount <2000) {
                try {
                      temp = "datagram://:" +base + Integer.toString(failCount);
                      PushRegistry.registerConnection(temp, midletClassName, filter);   
                      break;

                } catch (IOException ex) {
                   failCount++;
                   continue;
                } 

            } 

The Jury is still out though as to whether the application will start however!!!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top