File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes DategramPacket and DategramScoket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "DategramPacket and DategramScoket" Watch "DategramPacket and DategramScoket" New topic
Author

DategramPacket and DategramScoket

johny hanfei
Greenhorn

Joined: Nov 03, 2010
Posts: 3
I'm a Chinese.I'm a student in SouthEast University. I Come to this Forum for a better environment to learn java. I have some trouble about DategramPacket and DategramSocket.
I hope friends in this forum can help to solve this trouble. I have read Interiduction to java programming wrriten by Y.Danel Liang about one mouth. that book is also my frist book I used to leran java. My write English is poor. I am afraid I have some error in this passage.
The point of my qustion is that friends help me to understand the DategramPacket and DategramSocket more deeply.
Thanks in avdvance.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
你好!
What kind of problems do you have concerning DatagramPacket and DatagramSocket?
The more detailed description of the problems, the more likely it is that you get an answer.
Enclosing pieces of code is also a good idea, especially small, complete, examples that are runnable.
Finally, don't worry about your English!
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Jim Akmer
Ranch Hand

Joined: Jul 06, 2010
Posts: 104
To send data using a DatagramSocket you first create a DatagramPacket

Then you send the packet via the DatagramSocket


Hope this helps
johny hanfei
Greenhorn

Joined: Nov 03, 2010
Posts: 3
I have reviewed my book.Commuunication between clients and severs via a stream socket.Date is transmitted for using packet.Packet is transmitted by scoket But clients and severs do not have a dedicated channel. This transmision isn't guaranteed. So I doubt this transmission have using today? If it dose,why not I have no mistake happened when I download something or I upload something through the Internet.
I am major in Communiaction Engineering. I am not have wealth of konwledge about Internet. So I ask this question,I hope friends can help me through this trouble.
I do not have an accurate expression of the question.This have some relation with I don't use English frequently. I hope I can develop my understanding about java as well as pratice my English.
Thanks for you help!
To:Ivan Krizsan
I have view your photo and I think you may like travel. I will be horor to invite you come to China. Because China is a beautiful country,even though some place have been pollution in these years.
Jim Akmer
Ranch Hand

Joined: Jul 06, 2010
Posts: 104
@johny hanfei: You have to read about TCP and UDP. These are the 2 primary transport protocols today. UDP is unreliable and is what you are asking here. There is no connection between client and server and no guarantees of the packet delivery. But it is fast. TCP is reliable and connection-orriented. HTTP is over TCP and that is why you
have no mistake happened when I download something or I upload something through the Internet.

TCP is slower than UDP. They are used for different application domains depending on requirements. E.g. for voice transmission UDP would be prefered over TCP since it is much faster.
johny hanfei
Greenhorn

Joined: Nov 03, 2010
Posts: 3
Thanks for all of you. I will be reading some book about those two protocols. The computer world is so wonderful. I say this world is that where amazing happen. UDP is unreliable also used today is reasonable.
Why is my next question and I think the best way to fix it out is that reading some book.
Thanks for your guide!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DategramPacket and DategramScoket