我正在尝试select(int, fd_set, fd_set)为 UDP 套接字连接的函数设置超时。
当我设置第二个和 usecond 变量时,我得到Error this declaration has no storage class or type specifier。
这是代码
#define UTIMER 300000
#define STIMER 0 
struct timeval timeouts;
timeouts.tv_sec=STIMER;    // <-- ERROR HERE
timeouts.tv_usec=UTIMER;   // <-- ERROR HERE