C UDP Protocol Client And Server
gcc udpserver.c -o udpserver
gcc udpclient.c -o udpclient
Type | Usage |
---|---|
UDP Server | ./udpserver [port] |
UDP Client | ./udpclient [local_ip] [local_or_remote_port] |
if (setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR,&tr,sizeof(int)) == -1) {
perror("Setsockopt ");
exit(1);
}