PDA

Click to See Complete Forum and Search --> : The difference between TCP Protocol and UDP Protocol


omarswan
Jan 12th, 2000, 02:51 AM
Could someone clearly explain the difference between difference between TCP Protocol and UDP Protocol.

------------------
OmarSwan

omarswan@yahoo.com

http://omarswan.cjb.net (http://www.omarswan.cjb.net)

"Jesus is Lord"

compuGEEK
Jan 12th, 2000, 04:21 AM
This is from MSDN:

TCP Basics

The Transfer Control Protocol allows you to create and maintain a connection to a remote computer. Using the connection, both computers can stream data between themselves.

If you are creating a client application, you must know the server computer's name or IP address (RemoteHost property), as well as the port (RemotePort property) on which it will be "listening." Then invoke the Connect method.

If you are creating a server application, set a port (LocalPort property) on which to listen, and invoke the Listen method. When the client computer requests a connection, the ConnectionRequest event will occur. To complete the connection, invoke the Accept method within the ConnectionRequest event.

Once a connection has been made, either computer can send and receive data. To send data, invoke the SendData method. Whenever data is received, the DataArrival event occurs. Invoke the GetData method within the DataArrival event to retrieve the data.

UDP Basics

The User Datagram Protocol (UDP) is a connectionless protocol. Unlike TCP operations, computers do not establish a connection. Also, a UDP application can be either a client or a server.

To transmit data, first set the client computer's LocalPort property. The server computer then needs only to set the RemoteHost to the Internet address of the client computer, and the RemotePort property to the same port as the client computer's LocalPort property, and invoke the SendData method to begin sending messages. The client computer then uses the GetData method within the DataArrival event to retrieve the sent messages.



------------------
CompuGEEK

omarswan
Jan 12th, 2000, 04:28 AM
Thanks Alot.

------------------
OmarSwan

omarswan@yahoo.com

http://omarswan.cjb.net (http://www.omarswan.cjb.net)

"Jesus is Lord"

king_scott_2
Jan 27th, 2004, 01:41 AM
I love the control over the TCP Protocol but I find the best thing about the UDP Protocol is the speed and also the ability to broadcast messages to the entire network using the address 255.255.255.255