17 lines
331 B
C
17 lines
331 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include "sockets.h"
|
|
|
|
int main(int argc, char *argv[]) {
|
|
if (argc != 2) {
|
|
printf("Usage: %s <port>\n", argv[0]);
|
|
exit(1);
|
|
}
|
|
|
|
int sock = udp_create_socket();
|
|
udp_bind_socket(sock, atoi(argv[1]));
|
|
handle_udp_client(sock);
|
|
return 0;
|
|
}
|