Problem with remote applications interaction using URL

Thread Solved

Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Problem with remote applications interaction using URL

 
0
  #11
Nov 17th, 2008
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.
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Problem with remote applications interaction using URL

 
0
  #12
Nov 17th, 2008
sorry to bombard you with links, but here is another server example

http://fragments.turtlemeat.com/javawebserver.php
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 249
Reputation: Antenka has a spectacular aura about Antenka has a spectacular aura about Antenka has a spectacular aura about 
Solved Threads: 65
Antenka's Avatar
Antenka Antenka is offline Offline
Posting Whiz in Training

Re: Problem with remote applications interaction using URL

 
0
  #13
Nov 17th, 2008
Thanks I'll try...
So what if you can see the darkest side of me?
No one would ever change this animal I have become
Help me believe it's not the real me
Somebody help me tame this animal
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Problem with remote applications interaction using URL

 
0
  #14
Nov 17th, 2008
and also just to make sure you aren't running client and server on the same machine are you?
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 3,584
Reputation: jasimp has a spectacular aura about jasimp has a spectacular aura about jasimp has a spectacular aura about 
Solved Threads: 51
Featured Poster
jasimp's Avatar
jasimp jasimp is offline Offline
Senior Poster

Re: Problem with remote applications interaction using URL

 
0
  #15
Nov 17th, 2008
Originally Posted by dickersonka View Post
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
Originally Posted by Antenka View Post
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.
"Argyou not with the hand you are dealt in cards or life." ---- Wizard and Glass
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Problem with remote applications interaction using URL

 
0
  #16
Nov 17th, 2008
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
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 249
Reputation: Antenka has a spectacular aura about Antenka has a spectacular aura about Antenka has a spectacular aura about 
Solved Threads: 65
Antenka's Avatar
Antenka Antenka is offline Offline
Posting Whiz in Training

Re: Problem with remote applications interaction using URL

 
1
  #17
Nov 18th, 2008
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):
  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.
So what if you can see the darkest side of me?
No one would ever change this animal I have become
Help me believe it's not the real me
Somebody help me tame this animal
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Problem with remote applications interaction using URL

 
0
  #18
Nov 18th, 2008
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?
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 249
Reputation: Antenka has a spectacular aura about Antenka has a spectacular aura about Antenka has a spectacular aura about 
Solved Threads: 65
Antenka's Avatar
Antenka Antenka is offline Offline
Posting Whiz in Training

Re: Problem with remote applications interaction using URL

 
0
  #19
Nov 18th, 2008
Yeah ... I mean before. I've posted code for case, if someone be interested.
So what if you can see the darkest side of me?
No one would ever change this animal I have become
Help me believe it's not the real me
Somebody help me tame this animal
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Problem with remote applications interaction using URL

 
0
  #20
Nov 18th, 2008
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
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC