Re: DatagramSocketImpl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi João,
if you really want to access PlainDatagramImpl.getTimeToLive() on a
unicast datagram socket use reflection to call the getImpl() method (its
package private, so you have to enable accessibility) and cast the
result to PlainDatagramImpl.

Other than that you have to use a multicast socket to get/set ttl properly.

Regards
Robert


João Aguiam schrieb:
> I haven't explain myself correctly. This method is in DatagramSoctekImpl
> class. This class is abstract and java.net <http://java.net> doesn't
> provide a concretization. How can I solve this?
> 
> thanks
> joao
> 
> On Wed, Mar 26, 2008 at 2:12 PM, Andrew John Hughes
> <gnu_andrew@xxxxxxxxxxxxxx <mailto:gnu_andrew@xxxxxxxxxxxxxx>> wrote:
> 
>     On 26/03/2008, João Aguiam <joaoaguiam@xxxxxxxxx
>     <mailto:joaoaguiam@xxxxxxxxx>> wrote:
>     > Hello,
>     >
>     > I need to get the TTL of a Datagram Packet. I've found that the
>     package
>     > java.net <http://java.net> has an abstract class that has a method
>     getTimeToLive. Do you know
>     > if this method do what I want? And how can I implement that class.
>     I know
>     > gnu.java has a PlainDatagramSocketImpl class, althouth I can put
>     it working
>     > well, I only need that class and not the all package and it use native
>     > methods. Any one has any idea how can I solve this?
>     >
>     > Thank you,
>     > João
>     >
> 
>     You want the Time To Live (TTL) of a packet and you've found a method
>     called getTimeToLive.  I think you've answered your own question.
>     --
>     Andrew :-)
> 
>     Document Freedom Day - March 26th
>     http://documentfreedom.org
> 
>     Support Free Java!
>     Contribute to GNU Classpath and the OpenJDK
>     http://www.gnu.org/software/classpath
>     http://openjdk.java.net
> 
>     PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
>     Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
> 
> 


Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux