I am trying to implement a multimedia server application in NS-3 which can serve multiple clients.
Can a single NS-3 (TCP? and/or) UDP socket accept multiple simultaneous connections?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As stated in the ns-3 socket documentation, all socket calls in ns-3 are non-blocking (in contrast to the original socket API). This is a direct result of the asynchronous and event-based implementation model of ns-3.
The core concept to model a blocking socket call is to register a call-back which is invoked once a connection is established or data becomes available. One of these calls is ns3::Socket::SetRecvCallback which you can use to react to incoming packets
Of course, ns-3 can be used to implement a server that accepts multiple connections. For this purpose, you need to register to a call-back function such as ns3::Socket::SetRecvCallback and then to dispatch the received data adequately.