Skip to content

Commit cfe12db

Browse files
author
zhang xiao bin
committed
增加select
1 parent 88b3414 commit cfe12db

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

async_mysql/main.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313

1414
#ifdef _WIN32
1515
#include <Winsock2.h>
16+
typedef SOCKET fd_t;
1617
#else
1718
#include <sys/select.h>
19+
typedef int fd_t;
1820
#endif /* _WIN32 */
1921

2022
typedef struct mysql_context_s {
@@ -43,14 +45,6 @@ int hand_times = 0;
4345
// ========================================================
4446
// select
4547

46-
#ifdef _WIN32
47-
typedef SOCKET fd_t;
48-
#define __TACOPIE_INVALID_FD INVALID_SOCKET
49-
#else
50-
typedef int fd_t;
51-
#define __TACOPIE_INVALID_FD -1
52-
#endif /* _WIN32 */
53-
5448
fd_set m_rd_set;
5549
fd_set m_wr_set;
5650
std::unordered_map<fd_t, mysql_context_t*> m_tracked_sockets;

0 commit comments

Comments
 (0)