| 97 | } |
| 98 | |
| 99 | static void run(const char *local_addr, int inter, int mio_on, int need_echo) |
| 100 | { |
| 101 | SOCK_UDP *sock = udp_server_open(local_addr); |
| 102 | |
| 103 | if (sock == NULL) { |
| 104 | printf("open_sock error!\r\n"); |
| 105 | return; |
| 106 | } |
| 107 | |
| 108 | if (mio_on) |
| 109 | mio(sock, inter, need_echo); |
| 110 | else |
| 111 | sio(sock, inter, need_echo); |
| 112 | |
| 113 | udp_close(sock); |
| 114 | } |
| 115 | |
| 116 | typedef struct { |
| 117 | char local[64]; |
no test coverage detected