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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -