tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lorenz Breu <...@hot-shot.com>
Subject Re: tomcat-native: multicast on win32
Date Fri, 13 Feb 2009 15:55:30 GMT
>
> Try Multicast.loopback if Multicast.join fails.
> Win32 is pretty weired, and not sure why the join doesn't work.
> I suppose the multicast group needs to exists before joining.
>
no cigar. i first expected an APR_ENOTIMPL or even a failure, but i get
APR_SUCCESS all the way... but nothing actually happens... works fine
with linux though, so i guess it's either me being lucky that linux is
catching my mistake, or there being a problem with the apr code on my
win32 machine (xp pro).

do i need to specify a source when i join a group? isn't NOT specifying
one safer than specifying one, as i want to accept all muslticast
messages to that address, no matter where they come from??

here is what i have been doing:
i actually used 0 instead of the specific interface, then i thought
windows may need to be specified an address, but both approaches do the
same thing: return success and do nothing. all individual steps below
return APR_SUCCESS.


long ifa = Address.info("192.168.2.100", Socket.APR_INET, 0, 0, pool);
Multicast.ointerface(handle, ifa);
long ra;
ra = Address.info("234.255.255.253", 0, 0, 0, pool);
Multicast.loopback(handle, true);
Multicast.join(handle, ra, ifa, 0);
Socket.optSet(handle, Socket.APR_SO_NONBLOCK, 1);
Socket.timeoutSet(handle, 0);
Socket.optSet(handle, Socket.APR_SO_REUSEADDR, 1);
Socket.optSet(handle, Socket.APR_SO_RCVBUF,
getSessionConfig().getReceiveBufferSize());
long sa;
sa = Address.info(la.getAddress().getHostAddress(), Socket.APR_INET,
la.getPort(), 0, pool);
result = Socket.bind(handle, sa);





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message