This is a multi-part message in MIME format.
------ extPart_000_0082_01C119C0.9C6CDD40
Content-Type: text/plain;
charset so-8859-1"
Content-Transfer-Encoding: quoted-printable
Does anyone have example code for joining/leaving multicast groups using the UDPSocket?
Also, how is it possible to write this in a platform independent manner? s far as I can tell, the API for setting socket options seems to be completely platform dependent. It is also hard to code to, because you have to build strings of binary data that contain valid C structures used by the OS APIs. Would there be interest in code to replace or wrap setsockopt/getsockopt with methods and attribute accessors?
For example:
socket = UDPSocket.new
socket.add_membership "240.212.100.200" # or whatever a valid IP group number is
socket.ip_multicast_ttl = Socket::TTL_LOCAL_NETWORK
socket.ip_multicast_loopback = false
socket.sol_reuse_address = true
socket.bind( 15630 )
Or:
socket = TCPSocket.new( 'www.b13media.com', 80 )
socket.sol_sndbuf = 512
socket.sol_rcvbuf = 4096
Would this be a useful RCR?
Cheers,
Nat.
------ extPart_000_0082_01C119C0.9C6CDD40
Content-Type: text/html;
charset so-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Does anyone have example code for joining/leaving
multicast groups using the UDPSocket?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Also, how is it possible to write this in a
platform independent manner? As far as I can tell, t</FONT><FONT
face=Arial size=2>he API for setting socket options seems to be completely
platform dependent. It is also hard to code to, because you have to
build strings of binary data that contain valid C structures used by the OS
APIs. Would there be interest in code to replace or wrap
setsockopt/getsockopt with methods and attribute accessors? </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>For example:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>socket = UDPSocket.new</FONT></DIV>
<DIV><FONT face=Arial size=2>socket.add_membership "240.212.100.200" # or
whatever a valid IP group number is</FONT></DIV>
<DIV><FONT face=Arial size=2>socket.ip_multicast_ttl =
Socket::TTL_LOCAL_NETWORK</FONT></DIV>
<DIV><FONT face=Arial size=2>socket.ip_multicast_loopback = false</FONT></DIV>
<DIV><FONT face=Arial size=2>socket.sol_reuse_address = true</FONT></DIV>
<DIV><FONT face=Arial size=2>socket.bind( 15630 )</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Or:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>socket = TCPSocket.new( 'www.b13media.com', 80
)</FONT></DIV>
<DIV><FONT face=Arial size=2>socket.sol_sndbuf = 512</FONT></DIV>
<DIV><FONT face=Arial size=2>socket.sol_rcvbuf = 4096</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Would this be a useful RCR?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Cheers,</FONT></DIV>
<DIV><FONT face=Arial size=2> Nat.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>
------ extPart_000_0082_01C119C0.9C6CDD40--