• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 40. Network Programming > Communicating with Datagram Sockets

Communicating with Datagram Sockets

Communicating using datagram sockets is simpler than using the TCP-based sockets (Socket and ServerSocket) that you used for the TServer. Communication is also faster because no connection overhead exists. There is also no attempt to send packets again if an error occurs or sequencing of multiple packets, as occurs in TCP/IP transmissions.

A datagram packet is sent as an array of bytes to a receiving program, presumably listening at a particular IP address and port. If the receiving program gets the datagram and wants to send a reply, it becomes the sender, addressing a datagram back to a known IP address and port. The conversation style is a bit like those two-way radios in airplanes in which the pilot sends a message, says "Over," and waits for the controller to respond.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint