Hi,

I was running two instances of SEMS on the same machine and noticed that the 
stats plug-in has no problem binding to the same IP/PORT in each process. 
Looking at the code, my guess is that it's not the intended behaviour, and of 
course it doesn't work correctly. 
On the other hand, the sipctrl plug-in wouldn't do the same, which is OK.
After some reading I concluded that the difference is caused by the order of 
bind() and setsockopt(SO_REUSEADDR): if bind comes first, the kernel won't 
allow the multiple binding, which is good, because SO_REUSEADDR should only be 
used on an UDP socket in case of multicast and broadcast packets, but we don't 
use them. With TCP it would permit us rapid restart, but in case of UDP it's 
not necessary, the setsockopt(SO_REUSEADDR) is useless in sipctrl and actually 
a bug in stats. I would recommend removing them.

br

Szo
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to