ServerProxy icon indicating copy to clipboard operation
ServerProxy copied to clipboard

SocketTimeoutException on socket.accept()

Open neslihanturan opened this issue 8 years ago • 2 comments

Hi, I just tried this library for a media player application. But I get SocketTimeoutException in ServerProxy.java file, at line 115. The code is on that line is very critical: "Socket client = socket.accept();". It is normal because you set socket timeout to 5 seconds. However, my question is why connection is never established (even if I remove timeout, it waits forever)? Did you experience such case?

neslihanturan avatar Dec 07 '16 11:12 neslihanturan

+1 same problem

spartacus777 avatar Jul 18 '17 11:07 spartacus777

You can increase the timeout, but you shouldn't be getting a SocketTimeoutException because it is being handled in the loop: https://github.com/daneren2005/ServerProxy/blob/master/src/github/daneren2005/serverproxy/ServerProxy.java#L126. How are you trying to connect to the ServerProxy after you start it? Are you using getPrivateAddress()?

daneren2005 avatar Jul 21 '17 20:07 daneren2005