@ -13,19 +13,20 @@ using namespace marcelb::asynco;
int main ( ) {
try {
MySQL mydb ( " tcp://192.168.2.10:3306 " , " dinio " , " H€r5elfInd1aH@nds " , " dinio " , 5 , time_loop_type : : internal ) ;
// MySQL mydb("tcp://bitelex.ddns.net:3306", "dinio", "H€r5elfInd1aH@nds", "dinio", 10, time_loop_type::external);
// MySQL mydb("tcp://192.168.2.10:3306", "dinio", "H€r5elfInd1aH@nds", "dinio", 5, time_loop_type::internal);
MySQL mydb ( " tcp://bitelex.ddns.net:3306 " , " dinio " , " H€r5elfInd1aH@nds " , " dinio " , 5 , time_loop_type : : external ) ;
// MySQL mydb("tcp://bitelex.ddns.net:3306", "dinio", "H€r5elfInd1aH@nds", "dinio", 5);
mydb . set_on_error ( [ ] ( const string & error ) {
mydb . on_error = [ ] ( const string & error ) {
cout < < error < < endl ;
} ) ;
} ;
periodic mysql_tloop ( [ & mydb ] ( ) {
cout < < " loop--------------------------- " < < endl ;
mydb . tloop ( ) ;
} , MYSQL_PERIODIC_INTERNAL_TIME ) ;
while ( true ) {
sleep ( 5 ) ;
auto start = high_resolution_clock : : now ( ) ;
@ -44,8 +45,8 @@ int main() {
cout < < column_name < < endl ;
}
} catch ( const string er r) {
cout < < err < < endl ;
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
}
} ) ;
@ -63,8 +64,8 @@ int main() {
cout < < column_name < < endl ;
}
} catch ( const string er r) {
cout < < err < < endl ;
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
}
} ) ;
@ -82,8 +83,8 @@ int main() {
cout < < column_name < < endl ;
}
} catch ( const string er r) {
cout < < err < < endl ;
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
}
} ) ;
@ -101,8 +102,8 @@ int main() {
cout < < column_name < < endl ;
}
} catch ( const string er r) {
cout < < err < < endl ;
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
}
} ) ;
@ -120,8 +121,8 @@ int main() {
cout < < column_name < < endl ;
}
} catch ( const string er r) {
cout < < err < < endl ;
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
}
} ) ;
@ -139,8 +140,8 @@ int main() {
cout < < column_name < < endl ;
}
} catch ( const string er r) {
cout < < err < < endl ;
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
}
} ) ;
@ -156,9 +157,10 @@ int main() {
auto duration = duration_cast < microseconds > ( end - start ) ;
cout < < " -------------Izvršilo se za: " < < ( double ) ( duration . count ( ) / 1000.0 ) < < " ms " < < endl ;
sleep ( 100 ) ;
}
sleep ( 100 ) ;
} catch ( const SQLException error ) {
cout < < error . what ( ) < < endl ;
} catch ( const string error ) {