resp协议定义, xml定义配置文件

This commit is contained in:
1iaan
2026-01-19 10:37:32 +00:00
parent e404554363
commit bb2c4275cb
46 changed files with 9998 additions and 473 deletions

View File

@@ -0,0 +1,49 @@
#include "nty_coroutine.h"
#include <stdio.h>
#include <string.h>
#include <mysql.h>
void func (void *arg) {
MYSQL* m_mysql = mysql_init(NULL);
if (!m_mysql) {
printf("mysql_init failed\n");
return ;
}
if (!mysql_real_connect(m_mysql,
"192.168.233.133", "king", "123456",
"KING_DB", 3306,
NULL, CLIENT_FOUND_ROWS)) {
printf("mysql_real_connect failed: %s\n", mysql_error(m_mysql));
return ;
} else{
printf("mysql_real_connect success\n");
}
}
int main() {
#if 1
init_hook();
nty_coroutine *co = NULL;
nty_coroutine_create(&co, func, NULL);
nty_schedule_run(); //run
#else
func(NULL);
#endif
}