You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If reccont is true you must handle any Error Exception and Logic for any errro Example:
if connection initialized and server up down
if server up down and you initialized connection
` .catchError((error) {
if (error is SocketException) {
// Обработка работает
if(error.osError!.errorCode == 110){
// SocketException: OS Error: Connection timed out, errno = 110 If server connection close
// Логика для обработки ошибки 110 сервер не доступен, при инницилизации подключения
// Функция для переподклбчения
// Logic for this error
print('Ошибка поймана: ${error.osError!.errorCode}');
}
} else {
// if connection initialized and server up down - I/flutter (14205): Exception: ClientException: Connection closed before full header was received, uri=http://url:3000/iot?host=abfarm-us-west1-c-0089
print('Exception: $error');
}
})
.catchError((e) {
// Количесвто возможных ошибок (2) не включая когда отключают adapter wifi или eth это 3
// Еще проверить когда отключают adapter wifi или eth это 3
// 1. Когда подключение инициированно, после отключения сервера ошибка ->
// - I/flutter (14205): Exception: ClientException: Connection closed before full header was received, uri=http://url:3000/iot?host=abfarm-us-west1-c-0089
// 2. Когда сервер недоступен при инницирование подключение
// - Exception: ClientException with SocketException: Connection timed out (OS Error: Connection timed out, errno = 110), address = url, port = 33678, uri=http://url:3000/iot?host=abfarm-us-west1-c-0089
@devprog777, Thanks for filing this issue. I want to ensure I fully understand your concern. Is this the issue you are encountering?
When reccont is set to true, please ensure proper error handling for all exceptions and logic errors. For example:
- Handle cases where the connection is initialized but the server goes down.
- Handle scenarios where the server is down when you attempt to initialize a connection.
The code should properly catch and manage exceptions like SocketException with an error code of 110, indicating a timeout, which suggests the server is unavailable. Implement logic for reconnection in these cases. Additionally, address the scenario where the client's connection is closed before the full header is received, identifying it as a different error scenario
If reccont is true you must handle any Error Exception and Logic for any errro Example:
if connection initialized and server up down
if server up down and you initialized connection
` .catchError((error) {
if (error is SocketException) {
// Обработка работает
if(error.osError!.errorCode == 110){
// SocketException: OS Error: Connection timed out, errno = 110 If server connection close
// Логика для обработки ошибки 110 сервер не доступен, при инницилизации подключения
// Функция для переподклбчения
// Logic for this error
print('Ошибка поймана: ${error.osError!.errorCode}');
}
} else {
// if connection initialized and server up down - I/flutter (14205): Exception: ClientException: Connection closed before full header was received, uri=http://url:3000/iot?host=abfarm-us-west1-c-0089
print('Exception: $error');
}
})
.catchError((e) {
// Количесвто возможных ошибок (2) не включая когда отключают adapter wifi или eth это 3
// Еще проверить когда отключают adapter wifi или eth это 3
// 1. Когда подключение инициированно, после отключения сервера ошибка ->
// - I/flutter (14205): Exception: ClientException: Connection closed before full header was received, uri=http://url:3000/iot?host=abfarm-us-west1-c-0089
// 2. Когда сервер недоступен при инницирование подключение
// - Exception: ClientException with SocketException: Connection timed out (OS Error: Connection timed out, errno = 110), address = url, port = 33678, uri=http://url:3000/iot?host=abfarm-us-west1-c-0089
print('Exception: $e');
// _attemptReconnectIfNeeded();
});`
The text was updated successfully, but these errors were encountered: