Hi,
I am bit new to the network programming. I am developing a server based on Mina
using datagram sockets. I am bit confused with the datagram sockets here. When
I start an instance of the server on a port (say 1812) it starts. However,
when I run a second instance of the server on same port, it also binds to that
port successfully. I am expecting that the bind should fail here as the port is
already in use, the TCP/IP way. Is it an expected behavior of UDP datagrams?
If this is the expected behavior, how do I know which instance of the server
receives the packets?
Basically, I am trying to develop a RADIUS server on top of Mina. The server is
up and running. However, if there are multiple instances of the server running,
sometimes I am facing strange behavior in terms of none of the servers are
receiving the packets.
Can someone provide any pointers on how to developa datagram server reliably. I
also want to provide some start, shutdown scripts that allows the users to
start, stop the server. For this, any guidance on what is the approach to be
followed. If I start the server in a new thread, and close the main program,
the server thread also (being child) is getting closed. So, do I need to start
a separate port on which server listens for administrative commands like start,
shutdown? In such case how to provide authentication of it? Or shall I need to
use some shared memory (flag) that will be used by both server and
startup/shutdown scripts. In such case the server requires constant polling of
the shared variable to start/stop the server.
Also does the RADIUS need to be mandatarily supported only on UDP?
Sorry for my stupid questions, but, any ideas/guidance on same is highly
appreciated.
Regards,
Hari