Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

DatagramPacket

Thread view: 
Eitan M - 26 Jul 2006 20:10 GMT
What are the common uses of DatagramPacket ?

Can the DatagramPacket send and recieve more complicated strings then just
an array of bytes ?
Is it common thing to do : sending & recieving more than just array of
bytes, such as sending & recieving objects (or it is generally used by TCP
Socket) ?

Thanks :)
Knute Johnson - 26 Jul 2006 20:28 GMT
> What are the common uses of DatagramPacket ?
>
[quoted text clipped - 5 lines]
>
> Thanks :)

Everything is bytes.  The problem comes when you want to make it into
something you recognize.  So if you can turn in into bytes and turn it
back you can use Datagrams.

Signature

Knute Johnson
email s/nospam/knute/

Mark Space - 27 Jul 2006 08:00 GMT
> What are the common uses of DatagramPacket ?

In my experience, games and very simple network protocols.

> Can the DatagramPacket send and recieve more complicated strings then just
> an array of bytes ?
> Is it common thing to do : sending & recieving more than just array of
> bytes, such as sending & recieving objects (or it is generally used by TCP
> Socket) ?

Everything is bytes, including TCP.  But generally yes I think, TCP is
preferred for more complicated stuff, just because the Transport is
useful, and would have to be re-invented on datagrams.
Chris Uppal - 27 Jul 2006 09:09 GMT
> What are the common uses of DatagramPacket ?

Anything where you don't care if some data doesn't get to the other end or
arives in the wrong order.  Some reasons why you might not care:
   Because the data just isn't that important;
       (e.g. some logging).
   Because arriving late is just as bad as not arriving at all;
       (e.g. audio streaming).
   Because a higher-level of the protocol provides its own checking;
       (arguably DNS lookups fit this scenario).

> Can the DatagramPacket send and recieve more complicated strings then just
> an array of bytes ?

No, not unless you convert the "complicated strings" to bytes yourself.  Same
goes for TCP/IP transmission (and, come to that, to files too).

   -- chris


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.