@ -13,20 +13,19 @@ 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 " , 5 , 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", 10, time_loop_type::external);
// MySQL mydb("tcp://bitelex.ddns.net:3306", "dinio", "H€r5elfInd1aH@nds", "dinio", 5);
mydb . on_error = [ ] ( const string & error ) {
mydb . set_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 ( ) ;
@ -45,8 +44,8 @@ while (true) {
cout < < column_name < < endl ;
}
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
} catch ( const string er r) {
cout < < err < < endl ;
}
} ) ;
@ -64,8 +63,8 @@ while (true) {
cout < < column_name < < endl ;
}
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
} catch ( const string er r) {
cout < < err < < endl ;
}
} ) ;
@ -83,8 +82,8 @@ while (true) {
cout < < column_name < < endl ;
}
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
} catch ( const string er r) {
cout < < err < < endl ;
}
} ) ;
@ -102,8 +101,8 @@ while (true) {
cout < < column_name < < endl ;
}
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
} catch ( const string er r) {
cout < < err < < endl ;
}
} ) ;
@ -121,8 +120,8 @@ while (true) {
cout < < column_name < < endl ;
}
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
} catch ( const string er r) {
cout < < err < < endl ;
}
} ) ;
@ -140,8 +139,8 @@ while (true) {
cout < < column_name < < endl ;
}
} catch ( const SQLException erro r) {
cout < < error . what ( ) < < endl ;
} catch ( const string er r) {
cout < < err < < endl ;
}
} ) ;
@ -157,10 +156,9 @@ while (true) {
auto duration = duration_cast < microseconds > ( end - start ) ;
cout < < " -------------Izvršilo se za: " < < ( double ) ( duration . count ( ) / 1000.0 ) < < " ms " < < endl ;
}
sleep ( 100 ) ;
} catch ( const SQLException error ) {
cout < < error . what ( ) < < endl ;
} catch ( const string error ) {