943,776 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 1727
  • Java RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Nov 17th, 2008
0

Re: Problem with remote applications interaction using URL

sorry don't have time to debug it right now,
are you getting an ioexception in the server from the first trycatch?
Last edited by dickersonka; Nov 17th, 2008 at 5:38 pm.
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Nov 17th, 2008
0

Re: Problem with remote applications interaction using URL

sorry to bombard you with links, but here is another server example

http://fragments.turtlemeat.com/javawebserver.php
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Nov 17th, 2008
0

Re: Problem with remote applications interaction using URL

Thanks I'll try...
Reputation Points: 293
Solved Threads: 82
Posting Whiz
Antenka is offline Offline
361 posts
since Nov 2008
Nov 17th, 2008
0

Re: Problem with remote applications interaction using URL

and also just to make sure you aren't running client and server on the same machine are you?
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Nov 17th, 2008
0

Re: Problem with remote applications interaction using URL

and also just to make sure you aren't running client and server on the same machine are you?
I have never had trouble running a server and client on the same machine before, but I haven't looked through the code here to see if they are doing anything different than I usually do. However in an earlier post the OP posted
Click to Expand / Collapse  Quote originally posted by Antenka ...
it reads information:
"
POST / HTTP/1.1
Connection: close
Keep-Alive: 300
User-Agent: Java/1.6.0_07
Host: localhost:2604
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Content-type: application/x-www-form-urlencoded
Content-Length: 38
Looking at where it says Host: localhost:2604 led me to believe it is being run on the same machine.
Last edited by jasimp; Nov 17th, 2008 at 8:29 pm.
Featured Poster
Reputation Points: 533
Solved Threads: 53
Senior Poster
jasimp is offline Offline
3,593 posts
since Aug 2007
Nov 17th, 2008
0

Re: Problem with remote applications interaction using URL

ah hah, forgot to look at the previous post, i've had some trouble, normally not, but sometimes yes, just want to try and eliminate all possibilities
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Nov 18th, 2008
1

Re: Problem with remote applications interaction using URL

Oh ... it never ends Thanks a lot for spending time working with me and my problem. I have tried new variant - same trouble. I found the way to pass through this problem:
I add "\n\n" in the end of request and then when reading from stream I'm checking, if the string ends on "\n\n" i break the cycle.
Here is updated server code (reading part):
java Syntax (Toggle Plain Text)
  1. while (true)
  2. {
  3. int b = is.read();
  4. if (b == -1)
  5. break;
  6. request += (char)b;
  7. if(request.endsWith("\n\n"))
  8. break;
  9. }
It is workibg!
Just interesting, what is wrong? Have any ideas what is that?

P.S. about client and server on same machine: this is 3rd home work. Previous 2 also used interacting remote and I tested them on my machine and all works normally.
Last edited by Antenka; Nov 18th, 2008 at 4:33 pm.
Reputation Points: 293
Solved Threads: 82
Posting Whiz
Antenka is offline Offline
361 posts
since Nov 2008
Nov 18th, 2008
0

Re: Problem with remote applications interaction using URL

lol it is working and you are asking what is wrong?

what part doesn't work? or you mean why it didn't work before?
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Nov 18th, 2008
0

Re: Problem with remote applications interaction using URL

Yeah ... I mean before. I've posted code for case, if someone be interested.
Reputation Points: 293
Solved Threads: 82
Posting Whiz
Antenka is offline Offline
361 posts
since Nov 2008
Nov 18th, 2008
0

Re: Problem with remote applications interaction using URL

i believe its because you have to "tell" the server when you are done sending, since you want the server to send the request back you have to say i'm done, now send the information
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Listing questions
Next Thread in Java Forum Timeline: need working code in java of SMTP and pop3





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC