Hello, I'm developing a client app.
It is developed so that data transmission can be made through a socket connection from an app to a specific server.
However, even though the data signal strength and data connection status are sometimes said to be good, the Socket connection cannot be connected because ConnectException or SocketTimeoutException errors keep coming out when connecting to Socket.
I don't know how to make an exception at times like this.
For example, if a socket connection fails when connecting to a socket, is there a way to change the Socket's channel (?) to enable the connection?
Please give me an answer.
Thank you.
android socket connectexception sockettimeoutexception
private static void connect(String uri) throws IOException, URISyntaxException {
try {
socket = new Socket();
SocketAddress addr = new InetSocketAddress("192.168.17.1", 8080);
socket.setSoTimeout(connection_timeout);
socket.connect(socketAddress, connection_timeout);
} } catch (ConnectException exception) {
//to do
} } catch (SocketTimeoutException exception) {
//to do
} } catch (Throwable throwable) {
//to do
}
}
This is how it's done, right?
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
918 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
621 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.