Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

putting request inside response  RSS feed

 
ajse ruku
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a http server and client programs.As my server can only send response to my client's request,there is no way to send a new request from my server to my client.Is is possible to put the new request inside the response,which the server is sending to the client?

with regards,
ajse
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not clear on what you're trying to do. What kind of information/data/whatever should the server send to the client which you consider to be a "request"? Tells us a bit more about what purpose this would serve.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ajse roy:
Hi all,
I have a http server and client programs.As my server can only send response to my client's request,there is no way to send a new request from my server to my client.Is is possible to put the new request inside the response,which the server is sending to the client?

with regards,
ajse

There can only be one server response per client request.
Nesting objects (which are only an abstraction of the request/response model) will do nothing to change this.

If you want to trigger a new request, you will need to do that with client side code; either a META REFRESH tag or with Javascript.

As Ulf mentioned, giving us some more details about the problem you're trying to solve would be helpful.
 
ajse ruku
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
So I have the folowing issue.My server has two clients.first cleint sends its request(http) to the server.Now this request should be sent to the other client by the server.So as server cannot redirect this request to the other client as the second client is inside a firewall,so the server can only send response to the second client.So is there any way, the server can put the request of the first client inside the response of the second client?

with regards,
ajse
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there will be no response to the second client until it makes a request to the server first. You could have the second client make periodic requests to the server, to see if there is some data from the first client. Those requests would continue until there is some data to be retrieved.
[ July 14, 2006: Message edited by: Ulf Dittmer ]
 
ajse ruku
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer ,
You are correct.But my question still remains.when the server receives the request from the second client,it will put the request of the first client inside the response of the second client.But how to implement this in java ,I do not know.Do you have any idea?Is there any other way to do the above thing?

with regards,
ajse
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If by "request" you mean an HTTP request, then there is no meaningful way to do this. HTTP requests go from an HTTP client to an HTTP server; outside of that, they have no meaning. You will need to extract whatever data is in the first request, and send that as part of the response to the second client once that connects to the server.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you're trying to implement an AIM like chat client.

These apps are usually done with stateful sockets (as opposed to stateless HTTP connections). Some webapps mimick a stateless environment by having all clients poll the server every n seconds to see if there is new message.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!