servlets - Can we Communicate twice from HttpURLConnection request in java? -
i have client/server architecture , problem facing this. here client
java program , connect using httpurlconnection
, server servlet. once client make request servlet sends file through stream . , client download stream . process working fine . problem suppose if file not download in client , client has send message server send file again (i want happen without making new connection). how achieve in single request. can me in this.
why dont write infinite while loop, keep connecting server until positive response. mean
// create connection instance while(true){ try{ // connect server , file break; } catch (exception ){ // something} }
Comments
Post a Comment