Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mark Mescher
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post some of the code around this? Maybe we can spot something odd in it.
 
Mark Mescher
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic