java - How does socket.setSoTimeout works? -
i have code service:
inputstream readein = socket.getinputstream(); char [] buffer = new char[1024]; bufferedreader in = new bufferedreader(new inputstreamreader(readein)); while((counter = in.read(buffer)) != -1) { socket.setsotimeout(300000); //read here }
i ask 2 questions:
- if, after 300000 milliseconds, doesn't read anything, there exception?
- every time while loop comes up, refreshes socket timeout? example read time out @ 100 seconds, when comes return @ 300 seconds?
thank answers.
Comments
Post a Comment