BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 09-24-2004, 08:28 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2004
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default HttpConnection -> timeout?

Please Login to Remove!

Hi,

I tested this code:

======================
httpCon = (HttpConnection)Connector.open(http://server:8080 /sync4j/sync;WAPGatewayIP=x.x.x.x;WAPGatewayAPN=so mething;WAPGatewayPort=9201");

httpCon.setRequestMethod(HttpConnection.POST);
httpCon.setRequestProperty("content-length" ,
String.valueOf(dataToSend.length) );
httpCon.setRequestProperty ("content-type" , "application/vnd.syncml+xml");

System.out.println("debug ------------->>>>>> 2-content length:" +
String.valueOf(dataToSend.length));

outputStream = httpCon.openDataOutputStream();

System.out.println("debug ------------->>>>>> 3");

outputStream.write(dataToSend);

System.out.println("debug ------------->>>>>> 4");

inputStream = httpCon.openDataInputStream();

System.out.println("debug ------------->>>>>> 5");

int size = (int)httpCon.getLength();

System.out.println("debug ------------->>>>>> 6");

====================================

but if length of dataToSend byte array is larger then 1385 byte, code some
time crashes at
inputStream = httpCon.openDataInputStream(), and some time code works well.
It's very strange..... (connection timeout?)
However, if length of dataToSend byte array is less then 1385 byte, code
works fine.

This is the output of JDE debug attached 7230 handleld:

=========================================

CMM: SyncContact no sig from 0x33
debug ------------->>>>>> 2-content length:1385
debug ------------->>>>>> 3
debug ------------->>>>>> 4
VM:+GC(T)

RX=174K,RF=284K,FF=6240K,HF=28322,OS=1673K,ON=16K ,OR=15,FR=556,HR=11,IS=1K
RA=1010K,RS=393K,RN=4K
TA=1449K,TS=1104K,TN=8K
PA=176K,PS=176K,PN=2K
R0=178K,2=7K,3=20K,7=5K,8=3K,9=410K,10=2K,12=46K, 13=7K,15=24K,16=308K
VM:+PPO
VMPOc=26,n=1601,s=1K,r=0
VM:PPOt=12,g=5,p=7769
VM:+RSF
VM:-RSF
VM:+RR
VM:-RR
VM:+CSF
VM:CSF
VM:CSF
VM:CSF
VM:CSF
VM:CSF
VM:-CSF

RX=184K,RF=696K,FF=6330K,HF=28354,OS=1515K,ON=14K ,OR=0,FR=0,HR=0,IS=1K
RA=598K,RS=0,RN=0
TA=1360K,TS=1340K,TN=10K
PA=175K,PS=175K,PN=1K
R0=178K,2=7K,3=20K,7=5K,8=3K,10=2K,12=46K,13=6K,1 5=24K,16=308K
VM:-GCt=1333,b=1,r=0,g=3,u=0,c=1
VM:+CR
VM:TI2R
VM:-CR=3
VM:+GC(F)
VM:-GCt=54,b=1,r=0,g=1
VM:+CR
VM:TR2I
VM:-CR=1

===========================================


Later I change
"outputStream.write(dataToSend);"

in

"for (int i = 0, l=dataToSend.length; i < l; i++) {
outputStream.write(dataToSend<i>);
outputStream.flush();
}

outputStream.close();
outputStream = null;"

but it works at the same way.

I can't understand....
Connection Buffer? Connection Timeout?

Thanks & thanks & thanks....
for any suggestion.
fabio
Offline  
Old 09-30-2004, 12:02 PM   #2 (permalink)
Retired BBF Moderator
 
Mark Rejhon's Avatar
 
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: Bold
Carrier: Rogers
Posts: 4,870
Post Thanks: 1
Thanked 0 Times in 0 Posts
Default

Paul Chalmers mentioned something interesting in RIM Developer forum on Sept 22nd, 2004:
Quote:
A followup: After communicating with RIM it turns out that this is a known issue, as it does leave requests queued even if they fail. Therefore, if you don't want the requests to queue up and be sent, you need to use the RadioInfo class to determine if the device is in coverage before sending.
Is this related?
__________________
Thanks,
Mark Rejhon
Author of XMPP extension XEP-0301:
www.xmpp.org/extensions/xep-0301.html - specification
www.realjabber.org - open source
Offline  
Old 09-30-2004, 12:06 PM   #3 (permalink)
Retired BBF Moderator
 
Mark Rejhon's Avatar
 
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: Bold
Carrier: Rogers
Posts: 4,870
Post Thanks: 1
Thanked 0 Times in 0 Posts
Default

Another interesting Blackberry Developer Forum post might reveal some useful info. ("HTTP in JDE")
__________________
Thanks,
Mark Rejhon
Author of XMPP extension XEP-0301:
www.xmpp.org/extensions/xep-0301.html - specification
www.realjabber.org - open source
Offline  
Old 09-30-2004, 01:50 PM   #4 (permalink)
New Member
 
Join Date: Aug 2004
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I suspect the problem is related to WAP payload - you have a limit for your message size (usually around 1400). If this is true it means you have to chunk your transmission.

HTH
Offline  
Old 05-31-2005, 11:49 AM   #5 (permalink)
New Member
 
Join Date: May 2005
Model: 7100T
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

what did u use on the server side to handle the request?
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.