• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLConnection

 
chris p
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys,
I was wondering...
if you were to make a URLConnection from an applet to a servlet, is there any way to keep that connection alive as a bi-directional link between the two, or is the connection a one shot deal? If it is possible to keep the connection alive, how would the servlet get a reference to it?
also, if it is a one shot deal, is there any way to create a bi-directional connection between an applet and a servlet? (ie is there any way to make an applet and a servlet behave as a client and a server)?
thanks again!
chris
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18282
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, URLConnection assumes the HTTP protocol of one request, one response. For performance reasons a web server can keep a channel open to a client, but the HTTP protocol applies regardless.
You could do "client/server" by opening a general socket connection, but it won't work for general clients on the Internet because a lot of clients are behind firewalls that only allow http (and maybe ftp). For INTRAnet purposes you have more flexibility. Among other things, you can use RMI or CORBA to do remote procedure calls and let the sordid little details of networking take place out of sight.
 
chris p
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic