Skip to content
Snippets Groups Projects
Commit 0821cbb7 authored by pr1n19's avatar pr1n19
Browse files

Added timeout to socket read operations

parent 368fc820
Branches
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ public class DStore { ...@@ -11,7 +11,7 @@ public class DStore {
//Take arguments from command line //Take arguments from command line
int port = Integer.parseInt(args[0]); int port = Integer.parseInt(args[0]);
int cPort = Integer.parseInt(args[1]); int cPort = Integer.parseInt(args[1]);
Float timeout = Float.parseFloat(args[2]); int timeout = Integer.parseInt(args[2]);
String fileFolder = args[3]; String fileFolder = args[3];
//Make connection with controller & listen to send acknowledgments //Make connection with controller & listen to send acknowledgments
...@@ -54,6 +54,7 @@ public class DStore { ...@@ -54,6 +54,7 @@ public class DStore {
try{ try{
//Accept connection to new thread //Accept connection to new thread
Socket client = ss.accept(); Socket client = ss.accept();
client.setSoTimeout(timeout);
//Make output stream returning to client //Make output stream returning to client
OutputStream out = client.getOutputStream(); OutputStream out = client.getOutputStream();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment