[Kamailio-Users] No UDP Address already in use?

mayamatakeshi mayamatakeshi at gmail.com
Sat Jan 31 03:03:39 CET 2009


On Sat, Jan 31, 2009 at 3:53 AM, Luciano Afranllie <listas.luafran at gmail.com
> wrote:

> On Thu, Jan 29, 2009 at 3:04 PM, mayamatakeshi <mayamatakeshi at gmail.com>
> wrote:
> > Hello,
> > If I start a second instance of kamailio by mistake, if the cfg file
> > instructs it to listen to tcp ports, the second instance will exit with
> > something like this:
> > tcp_init: bind(7, 0x81b28ec, 16) on 127.0.0.1:5060 : Address already in
> use
> >
> > But if the cfg file only instructs kamailio to bind to udp ports, the
> second
> > instance will not exit. Is this a bug?
> >
> > I'm curious because if we start kamailio and a udp port is in use by
> another
> > application (not kamailio), kamailio will exit with
> > udp_init: bind(4, 0x819f274, 16) on 192.168.88.29: Address already in
> use
> > Why is that so?
>
> That behavior may be possible if kamailio is setting SO_REUSEADDR
> socket option for udp but not for tcp.
>

Thanks Luciano,
I didn't know about that.
And you are right. As we can see at udp_server.c:

setsockopt(sock_info->socket, SOL_SOCKET, SO_REUSEADDR , ...

regards,
mayama
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20090131/eac01334/attachment.htm 


More information about the Users mailing list