Results 1 to 4 of 4

Thread: The difference between TCP Protocol and UDP Protocol

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    NY, USA.
    Posts
    240

    Post

    Could someone clearly explain the difference between difference between TCP Protocol and UDP Protocol.

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

    [email protected]

    http://omarswan.cjb.net


    "Jesus is Lord"



  2. #2
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281

    Post

    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


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    NY, USA.
    Posts
    240

    Post

    Thanks Alot.

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

    [email protected]

    http://omarswan.cjb.net


    "Jesus is Lord"



  4. #4
    Addicted Member
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    243
    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
    Scott
    **********
    Visit my web page at www.hyphenex.ugtech.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width