[javagroups-users] Sending and receiving serialized objects
Brought to you by:
belaban
From: Kai T. <em...@ka...> - 2009-10-30 19:40:25
|
Hello, I use these functions to send a serialized object to all nodes on a channel to send: pivate void stateUpdate(cNodeInfo newNodeInfo) throws Exception{ byte[] buf = Util.objectToByteBuffer(newNodeInfo); control_channel.send(null, null, buf); } and on the receiver side: public void receive(Message msg){ Object message_content; try { message_content = Util.objectFromByteBuffer(msg.getBuffer()); if (message_content instanceof cNodeInfo){ //Stuff to do with the NodeInfo } } The problem is that message_content instanceof cNodeInfo never evaluates to true. I have no idea why. This is maybe more a java related question and has nothing to do with jgourps, but I'm not sure. Greets, -- Kai Timmer | http://kaitimmer.de Email : em...@ka... Jabber (Google Talk): ka...@ka... ICQ: 67765488 |