Download presentation
Presentation is loading. Please wait.
1
The Transport Layer Socket 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
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.