[Spread-users] Getting started with spread
Rodrick Brown
rodrick.brown at gmail.com
Mon Feb 11 01:30:32 EST 2008
Hello all I'm very new to spread actually came across it today and wanted to
get a feel for it.
I'm using the java API and having a bit of trouble connecting to my spread
daemon and sending basic multicast messages.
>From my understanding the messages should be sent to stdout this does not
happen and i'm not seeing any received packets from spmonitor
Here is my simple test code.
[rbrown at macbookpro:/opt/spread/etc] $ egrep '^[^#]' spread.conf
Spread_Segment 127.0.0.255:4803 {
localhost 127.0.0.1
}
My java code.
public class SpreadExample {
public static void main(String[] args) throws IOException,
SpreadException {
SpreadVersion ver = new SpreadVersion();
SpreadMessage msg = new SpreadMessage();
SpreadGroup group = new SpreadGroup();
byte[] data = new byte[] {'h','e','l','l','o'};
SpreadConnection connection = new SpreadConnection();
InetAddress spreadhost = InetAddress.getByName("localhost");
connection.connect(spreadhost,4803,"group",false,false);
group.join(connection,"Agroup");
msg.setData(data);
msg.addGroup("Agroup");
connection.multicast(msg);
}
}
Thanks.
--
Rodrick R. Brown
http://www.rodrickbrown.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.spread.org/pipermail/spread-users/attachments/20080211/252702c6/attachment.html
More information about the Spread-users
mailing list