comp.lang.ada
 help / color / mirror / Atom feed
From: David Marceau <davidmarceau@sympatico.ca>
Subject: Re: ADA vs JAVA sockets
Date: Thu, 08 Jan 2004 02:09:46 -0500
Date: 2004-01-08T02:09:46-05:00	[thread overview]
Message-ID: <3FFD023A.26545D08@sympatico.ca> (raw)
In-Reply-To: as0itb.qme.ln@leia

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.



  reply	other threads:[~2004-01-08  7:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-07  8:39 ADA vs JAVA sockets Riccardo
2004-01-07 13:31 ` Duncan Sands
2004-01-07 16:28   ` Jano
2004-01-07 19:44   ` Pascal Obry
2004-01-07 21:11     ` Duncan Sands
2004-01-08 14:31       ` Gnat 3.15p bugs (was: ADA vs JAVA sockets) Jano
2004-01-08 16:24         ` Duncan Sands
2004-01-08 19:14           ` Jano
2004-01-08 20:16           ` tmoran
2004-01-08 20:58             ` Duncan Sands
2004-01-07 14:24 ` ADA vs JAVA sockets Stephen Leake
2004-01-07 15:43 ` Steve
2004-01-07 22:23 ` Frode Tennebø
2004-01-08  7:09   ` David Marceau [this message]
2004-01-08  8:32 ` More details on:--- ADA vs JAVA sockets--- Riccardo
2004-01-08 20:16   ` tmoran
2004-01-09  7:27     ` Riccardo
2004-01-09  8:45       ` Ole-Hjalmar Kristensen
2004-01-09 10:27         ` thanks Riccardo
2004-01-09 13:58           ` thanks Robert Spooner
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox