1 / 19

The Transport Layer Socket Programming

The Transport Layer Socket Programming. CE 306. Application to TCP Interface. process sends/receives messages to/from its socket. Berkley Socket Primitives for TCP. TCP Socket: Overall Structure. UDP Socket: Overall Structure. Bridge Between App and TCP. Binding to Server.

Download Presentation

The Transport Layer Socket Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Transport LayerSocket Programming CE 306

  2. Application to TCP Interface process sends/receives messages to/from its socket

  3. Berkley Socket Primitives for TCP

  4. TCP Socket: Overall Structure

  5. UDP Socket: Overall Structure

  6. Bridge Between App and TCP

  7. Binding to Server

  8. Server Waiting for Clients

  9. Server Accepting Client Requests

  10. TCP Data Exchange

  11. Send() and Receive() Variants

  12. UDP: Data Exchange

  13. Terminate the Connection

  14. Resolving Server and Client Addresses

  15. Gethostbyname(): Sample Call

  16. Example: UDP Client

  17. TCP: Simple ECHO Client #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h>

  18. TCP: Simple ECHO Server #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h>

  19. Example Code

More Related