Article View: cn.bbs.comp.lang.java
Article #23950Re: Help needed in Serialization and UDP/IP comms
From: Ed Onken
Date: Sun, 23 Aug 1998 00:00
Date: Sun, 23 Aug 1998 00:00
35 lines
2469 bytes
2469 bytes
Paul, I hope you haven't forgotten that UDP doesn't guarantee delivery of packets to their destination nor does it even guarantee that the sequence of received packets will be correct. Maybe that's why your objects are corrupted when they get read in? I don't know much about broadcasting, but maybe you should consider using TCP instead of UDP? Ed Paul Hussein wrote: > > I am currently trying to provide a generic class that will establish an > UDP/IP Broadcast connection and broadcast datagrams. > > The UDP/IP stuff is fine. However, I would like to be able to take a > java.lang.Object ( or an instance of a class that is inherited from it ) and > convert it into bytes in an automatic manner. > > I've tried to use streams, creating my own UDPBroadcastInput and Output > streams, but when I use the ObjectInputStream stream reader and writer the > app complains about the stream being corrupt when it tries to read from it. > I believe this is due to the version number being passed out from the > ObjectInputStream and ObjectOutputStream . Does anyone know of any way to > get round this. Alternatively is there a way of accessing serialization > without using these classes so that I can manipulate the stream of bytes > directly. > > I could always try to assign the object to an array of bytes as I would in > C, however I would need to know the size of the java.lang.Object and its > descendants. Is there a way of finding out ??? > > Any help would be very much appreciated > > Cheers
Technical Details
Message-ID:
<35E0CD46.58442631@midwest.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6rp73l$eel$1@plug.news.pipex.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10a146,c8630a16e525a9b X-Google-Attributes: gid10a146,public X-Google-Thread: f6cb0,c8630a16e525a9b X-Google-Attributes: gidf6cb0,public X-Google-Thread: 113ae9,c8630a16e525a9b X-Google-Attributes: gid113ae9,public From: Ed Onken <edonken@midwest.net> Subject: Re: Help needed in Serialization and UDP/IP comms Date: 1998/08/23 Message-ID: <35E0CD46.58442631@midwest.net> X-Deja-AN: 384056622 Content-Transfer-Encoding: 7bit References: <6rp73l$eel$1@plug.news.pipex.net> To: Paul Hussein <paul.hussein@dial.pipex.com> Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsabuse@supernews.com X-Trace: 903925340 .ZFUVYH4M1195D0EBC usenet53.supernews.com Organization: http://www.supernews.com, The World's Usenet: Discussions Start Here Mime-Version: 1.0 Newsgroups: cn.bbs.comp.lang.java,comp.lang.java.help,comp.lang.java.programmer