connect two agents via http-protocol in Java -
i working on project in java consists in connecting 2 agents via http-protocol using following scenario:
1) http-agent1 make connection http-agent 2 2) http-agent 2 send get-request http-agent 1 3) http-agent 1 sends asked resource http-agent 2 4) http-agent 1 stops connection
can according http-specification? little bit confused, because know 1 agent must listener , according scenario not know, agent must listener.
i using java-sockets. hard separate between making connection , making request.!!!!!!!!!!!according http-protocol, agent, making request, should make connection
http typically used client/server communication, example doesn't quite follow. in case, have following:
a connects b b requests a sends b closes connection b
basically, b acting server (waits connection) , client (requests data) part of server functionality handled (actually serving data). typical client-server version of trying go so:
b connects b requests a sends b or b initiate disconnect
however, http communication protocol, there no reason http won't work example. not standard usage of it, many of frameworks won't built accommodate exchange pattern building. not difficult build own code accomplish using. may want java httpurlconnection
class
Comments
Post a Comment