So guys, now let us do one small assignments on thread listeners.
So in this example or in this assignment, we will going to create a small application called listener
main dot exe.
Right.
This application would going to listen on multiple events at the same time.
So what we will going to do is that that our listener main dot exe application would going to launch
two listener threads.
Both the listener threads listens on an IP address.
127 .0.0.1 and on UDP port number 3000 and 3001 respectively.
Right.
So we will going to launch two packet listener threads and both the packet listener threads would going
to listen on an IP address and UDP port number.
Now our application will have a function called packet receive function.
Right?
And the purpose of this packet receive function is to process the packet which our application is receiving
from the outside world.
So what our packet listener thread is supposed to do is that they will going to listen on an IP address
and port number and once these packet listener thread receives the packet from the outside world, it
is the responsibility of these packets to inject or pump those packets into the application main code
so that our application can process those packets right.
Now in this function that is packet receive function, you don't have to write some sophisticated code
to parse or process the packet.
It is enough that you simply print some message that you have received some packet.
For example, you can print the packet size, right?
Packet receive function is simply the representation that our main application is receiving the packets
from the outside world via packet listener threads.
Right.
Then also our application must be in a position to interact with the user.
So we will going to launch a third thread called user interaction thread and its responsibility will
be only to receive inputs from the user and act on those inputs.
Right?
So in order to design this application, you need some socket programming because you would going to
launch packet listener threads which will going to listen on the sockets, right?
So for that I have provided the library network utils, storage and network utils dot c in this files
you have two APIs, UDP server create and start and UDP send message.
Right?
You need to use these APIs in order to accomplish this assignment.
I have also provided a separate executable called UDP sender dot x.
Right.
Using this executable you can actually generate UDP packets which are targeted to port number 3000 or
3001.
Right?
So you can use UDP standard dot x, which is already cooked up application in order to send packets
to your listener main dot x application and test whether your application is working as expected or
not.
Right?
So let us code up the listener main dot x and see things in action.
And of course this section needs that.
You have some basic background in socket programming.
So now in the next lecture video, let us see how to write listener underscore main dot x application
and after that there will be some couple of assignments in which you will going to add up some additional
logistics to this multiple events listening application.
Right.