Could someone clearly explain the difference between difference between TCP Protocol and UDP Protocol.
------------------
OmarSwan
[email protected]
http://omarswan.cjb.net
"Jesus is Lord"
Printable View
Could someone clearly explain the difference between difference between TCP Protocol and UDP Protocol.
------------------
OmarSwan
[email protected]
http://omarswan.cjb.net
"Jesus is Lord"
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
Thanks Alot.
------------------
OmarSwan
[email protected]
http://omarswan.cjb.net
"Jesus is Lord"
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