View Single Post
Old 08-06-2008, 07:33 AM   #7
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

I really don't know what else to tell you. On the client side I use code like this:
Code:
StreamConnectionNotifier notify = (StreamConnectionNotifier)Connector.open("http://:912");

boolean loop = true;
while (loop)
{
    StreamConnection stream = notify.acceptAndOpen();

    InputStream input = stream.openInputStream();
    StringBuffer sb = new StringBuffer();

    int datum = -1;
    while (-1 != (datum = input.read()) )
    {
          sb.append((char)datum);
    }
    stream.close();
 
    String contactData = sb.toString();
    // process contactData  
}
I use C or Perl programs to manage the push from the server side, but here is a dump of a push HTTP transaction:

Code:
GET /push?DESTINATION=2xxxxxxx&PORT=912&REQUESTURI=/ HTTP/1.1

Host: uniteserver:8080
Content-Type: application/octet-stream
X-RIM-Push-Channel-ID: SomeChannel
X-RIM-Push-Use-Coverage: true
X-RIM-Push-NotifyURL: http://pushserver/cgi-bin/notify.cgi
Content-Length: 4

data
This works for me.
Offline   Reply With Quote