[Spread-users] Problem with Java client

Jarosław Nozderko jaroslaw.nozderko at polkomtel.com.pl
Fri Aug 12 07:26:53 EDT 2005


 I have a problem with Spread Java client.
This is probably some my basic mistake, but I'd be
glad if anyone could take a look at this.

I created Java client, like this:

 // [1] Connecting:
 SpreadConnection  spreadConnection = new SpreadConnection();
 InetSocketAddress isa = new InetSocketAddress(spread_host, spread_port);
 InetAddress adr = isa.getAddress();
 spreadConnection.connect(adr, 0, private_name, false, true);
 // [2] Joining:
 String group = "grupa";
 SpreadGroup spreadGroup = new SpreadGroup();
 spreadGroup.join(spreadConnection, group);
 // [3] Sending message:
 SpreadMessage msg = new SpreadMessage();
 String target = "grupa";
 String text = "Hello from Java !";
 short type = 177;
 // [4] Leaving:
 // [5] Disconnecting:

If I don't join group "grupa" (sections [2] and [4] commented out), 
sending message works - group members receive it. Of course, there are
no membership messages. But if I try to send message to joined group 
(section [2] present, using SpreadMessage.addGroup(String) or 
SpreadMessage.addGroup(SpreadGroup)), group members get only membership 
messages - the message itself is *not* delivered (tried setReliable(),
setUnreliable() and setFifo()).

Do I miss something obvious ? If not, can anyone confirm/deny this ?
C client seem to work well, message is always delivered.

Spread version 3.17.2 on HP-UX B.11.11 U 9000/800, although 
Java SpreadVersion.get*Version reports 3.16.1.

$ java -version
java version ""
Java(TM) 2 Runtime Environment, Standard Edition (build
Java HotSpot(TM) Server VM (build 1.4.2 PA2.0 (aCC_AP), mixed mode)

Thanks for any help,

More information about the Spread-users mailing list