• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 364
  • Last Modified:

TCP/UDP in java package

Is there such thing as a TCP class in the java package?   Suppose if I want to send the data over a network using TCP or UDP.   For would I decide which one I want to use?   I know that you can implement your own protocol but if you want to use TCP or UDP, how is that possible?   I wanted to know since I couldn't find a class related to TCP or UDP in the java package.   A little explanation on how this works is appreciated.   Thanks.  
0
skyblue01
Asked:
skyblue01
  • 3
1 Solution
 
CEHJCommented:
All the TCP/IP classes are in the java.net package. The main ones are

Socket
ServerSocket
Datagram
URLConnection
0
 
CEHJCommented:
Sorry - not - 'Datagram' - i meant

DatagramSocket
DatagramPacket
0
 
skyblue01Author Commented:
Thanks.   So I guess for all the connections that uses Socket and ServerSocket are in fact TCP.   This will then indicate that for data sent using these TCP connections, I shouldn't be losing any data or getting delays along the way -- is that right?
0
 
CEHJCommented:
>>So I guess for all the connections that uses Socket and ServerSocket are in fact TCP.

Yes

>>shouldn't be losing any data or getting delays along the way -- is that right?
     
Shouldn't be no, so to answer your other question 'informally', the problem with unexpected data is probably a logic error

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now