aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes HTTPUrlConnection only works with Debugger-without I'm to fast??!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "HTTPUrlConnection only works with Debugger-without I Watch "HTTPUrlConnection only works with Debugger-without I New topic
Author

HTTPUrlConnection only works with Debugger-without I'm to fast??!!

Mark Mescher
Ranch Hand

Joined: Oct 25, 2004
Posts: 34
Hi,
i have a big problem with the HttpUrlConnection-Class.
I want to communicate with a HttpServerSoftware (not produced by me). Therefore I use the HttpUrlConnection-Class. This makes no problems if I use the Debugger and run the code step by step. But if I run the Software normally, it seems to be to fast for the server. The InputStrem delivered by getContent() is than empty. I dont know why and I dont have a solution for fixing this.
I have two options:
Use the debugger ever:-)Tell this my customers...
Slow down the Software. If I call getContent(), then do something else (empty for-loop with 10000000 iterations:-)) then it works also. But this isnt a nice solution.
Does anyone has a solution for me??

Thx

Mark
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Can you post some of the code around this? Maybe we can spot something odd in it.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Mark Mescher
Ranch Hand

Joined: Oct 25, 2004
Posts: 34
Hi, I'm using following method to get the stream:





I'm calling this method like this:
InputStream stream=connect(urlstring);

Before using this stream i MUST place a Breakpoint and wait a while before stepping through the code. I'm using this code to communicate with other servers (coded by my own) without problems. But here it doesnt work!!!

Mark
[ July 03, 2005: Message edited by: Mark Mescher ]
Mark Mescher
Ranch Hand

Joined: Oct 25, 2004
Posts: 34
Hi,
I solved the problem. The serversoftware produced an empty or not complete stream if the query-results were to large. The server-vendor fixed this bug and now it works fine...So my code wasnt the problem!
Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTPUrlConnection only works with Debugger-without I'm to fast??!!