From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,83a56cb8370ebd04 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-07 23:22:05 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.stanford.edu!cyclone.bc.net!news-in.mts.net!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Message-ID: <3FFD023A.26545D08@sympatico.ca> From: David Marceau X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.17-10mdksmp i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: ADA vs JAVA sockets References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Thu, 08 Jan 2004 02:09:46 -0500 NNTP-Posting-Host: 65.92.163.36 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1073546053 65.92.163.36 (Thu, 08 Jan 2004 02:14:13 EST) NNTP-Posting-Date: Thu, 08 Jan 2004 02:14:13 EST Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:4195 Date: 2004-01-08T02:09:46-05:00 List-Id: Frode Tenneb� wrote: > > On Wednesday 07 January 2004 09:39 Riccardo wrote: > > > Can I say thet JAVA brings such kind of problems? > > (the same program in ADA works fine with an application written in > > C++) It was just luck that you seemed to have no problem. UDP packets are not guaranteed to be delivered. If using UDP packets, essentially you could assign some kind of ticket number to every UDP packet and and then ensure at the receiving end you got all the tickets. There is the possibility that the order of reception is not as expected either and you have to sort/assemble them in the correct order at the receiving end. There is also the possibility that you need to request a specific packet with a specific ticket number to be resent. As you can see it gets tricky and that's why TCP exists because that's the kind of stuff it does for you along with other stuff :) > > As severel has said before, UDP does not guarantee delivery. My GUESS > is that the Ada end writes to the socket faster than the Java end can > consume it resulting in the OS' UDP buffer going full resulting in > packet loss. This is possible but please remember the java.net api is written as JNI/C code shipped in .so's/.dlls so it should be relatively fast anyways. Check the jdk sources if you don't believe me. What slows down the process in the JVM byte code interpretation some where before and after the calls are made to java.net. That said, I would suggest you use TCP sockets and not UDP sockets if you want to have the packets delivered reliably. If you would permit me to ask exactly what kind of application are you writing? Cheers.