BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 09-24-2004, 08:28 AM   #1
fabius
Knows Where the Search Button Is
 
Join Date: Sep 2004
Posts: 24
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
Mark Rejhon
Retired BBF Moderator
 
Mark Rejhon's Avatar
 
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: Bold
Carrier: Rogers
Posts: 4,870
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
Mark Rejhon
Retired BBF Moderator
 
Mark Rejhon's Avatar
 
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: Bold
Carrier: Rogers
Posts: 4,870
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
agent_mulder
New Member
 
Join Date: Aug 2004
Posts: 1
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
ethos71
New Member
 
Join Date: May 2005
Model: 7100T
Posts: 2
Default

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



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Audio Polarity Checker Phase Detector Self-Test Auto-Off PD-9A Speaker Tester picture

Audio Polarity Checker Phase Detector Self-Test Auto-Off PD-9A Speaker Tester

$43.00



IndusTec DC 20A Motor Polarity Reversing - Toggle Switch Maintained DPDT 3 Pos picture

IndusTec DC 20A Motor Polarity Reversing - Toggle Switch Maintained DPDT 3 Pos

$14.99



Polarity Reversing Momentary Rocker Switch 20A 12V DC Motor Control 7Pin up down picture

Polarity Reversing Momentary Rocker Switch 20A 12V DC Motor Control 7Pin up down

$23.00



One (1) DC Motor Reverse Polarity Switch 12v Reversing - 30A Rocker Momentary picture

One (1) DC Motor Reverse Polarity Switch 12v Reversing - 30A Rocker Momentary

$11.99



Industec Motor Polarity Reversing Momentary Switch DPDT 12V 24V 20AMPS SEE VIDEO picture

Industec Motor Polarity Reversing Momentary Switch DPDT 12V 24V 20AMPS SEE VIDEO

$9.29



IndusTec 30A Rocker Switch - Polarity Reversing DC Motor Control Momentary 12v  picture

IndusTec 30A Rocker Switch - Polarity Reversing DC Motor Control Momentary 12v

$13.99







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