Closed birdofpreyru closed 1 year ago
https://github.com/birdofpreyru/react-native-static-server/blob/458348a3e3345542a6092b83654dc1f7a9094248/android/src/main/java/com/drpogodin/reactnativestaticserver/ReactNativeStaticServerModule.java#L140
To try instead:
ServerSocket socket = new ServerSocket(); socket.setReuseAddress(true); socket.bind(null);
Otherwise, it seems, occasionally server may fail to bind to an automatically selected port as it stays in TIME_WAIT state after the selection.
TIME_WAIT
Not really needed.
https://github.com/birdofpreyru/react-native-static-server/blob/458348a3e3345542a6092b83654dc1f7a9094248/android/src/main/java/com/drpogodin/reactnativestaticserver/ReactNativeStaticServerModule.java#L140
To try instead:
Otherwise, it seems, occasionally server may fail to bind to an automatically selected port as it stays in
TIME_WAIT
state after the selection.