DO NOT USE THIS CODE ANY LONGER. TOO MUCH OUTDATED AND BUGGY
I am sharing a code for “UDP Server C++ Class with a listening thread”. In the class “UDPThread”, a thread is running to receive a UDP packet.
Just compile a demo program with this command. Then you will understand.
g++ demo_udp_server.cpp UDPThread.cpp -lpthread -o demo_udp_server
This is the result.
I hope this code helps your project.
-Mok-
This code has lots of bugs. Dont use it. Wsastartup does not exist. Array is defined [4] but 5th index is written with a value which crashes the exe.